Connect to QuickBooks from PowerBuilder using RSSBus ADO.NET Data Provider
- by dataintegration
The RSSBus ADO.NET providers are easy-to-use, standards based controls that can be used
from any platform or development technology that supports Microsoft .NET, including Sybase
PowerBuilder. In this article we show how to use the RSSBus ADO.NET Provider for QuickBooks
in PowerBuilder. A similar approach can be used from PowerBuilder with other RSSBus
ADO.NET Data Providers to access data from Salesforce, SharePoint,
Dynamics CRM, Google, OData, etc.
In this article we will show how to create a basic PowerBuilder application that performs CRUD
operations using the RSSBus ADO.NET Provider for QuickBooks.
Step 1: Open PowerBuilder and create a new WPF Window Application solution.
Step 2: Add all the Visual Controls needed for the connection properties.
Step 3: Add the DataGrid control from the .NET controls.
Step 4:Configure the columns of the DataGrid control as shown below. The column bindings
will depend on the table.
<DataGrid AutoGenerateColumns="False" Margin="13,249,12,14" Name="datagrid1" TabIndex="70" ItemsSource="{Binding}">
<DataGrid.Columns>
<DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=ID}" Header="ID" Width="SizeToHeader" />
<DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name}" Header="Name" Width="SizeToHeader" />
...
</DataGrid.Columns>
</DataGrid>
Step 5:Add a reference to the RSSBus ADO.NET Provider for QuickBooks assembly.
Step 6:Optional: Set the QBXML Version to 6. Some of the tables in QuickBooks require a later version of
QuickBooks to support updates and deletes. Please check the help for details.
Connect the DataGrid:
Once the visual elements have been configured, developers can use standard ADO.NET
objects like Connection, Command, and DataAdapter to populate a DataTable with the results
of a SQL query:
System.Data.RSSBus.QuickBooks.QuickBooksConnection conn
conn = create System.Data.RSSBus.QuickBooks.QuickBooksConnection(connectionString)
System.Data.RSSBus.QuickBooks.QuickBooksCommand comm
comm = create System.Data.RSSBus.QuickBooks.QuickBooksCommand(command, conn)
System.Data.DataTable table
table = create System.Data.DataTable
System.Data.RSSBus.QuickBooks.QuickBooksDataAdapter dataAdapter
dataAdapter = create System.Data.RSSBus.QuickBooks.QuickBooksDataAdapter(comm)
dataAdapter.Fill(table)
datagrid1.ItemsSource=table.DefaultView
The code above can be used to bind data from any query (set this in command), to the DataGrid. The DataGrid should
have the same columns as those returned from the SELECT statement.
PowerBuilder Sample Project
The included
sample project includes the steps outlined in this article. You will also need the QuickBooks
ADO.NET Data Provider to make the connection. You can download a free trial here.