Ready to get started?

Learn more about the CData ADO.NET Provider for SAP Business One DI or download a free trial:

Download Now

Connect to SAP Business One DI Data from PowerBuilder

This article demonstrates how to access SAP Business One DI data from PowerBuilder using the CData ADO.NET Provider for SAP Business One DI.

The CData 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 PowerBuilder. This article shows how to use the CData ADO.NET Provider for SAP Business One DI in PowerBuilder.

This article shows how to create a basic PowerBuilder application that uses the CData ADO.NET Provider for SAP Business One DI to retrieve data.

  1. In a new WPF Window Application solution, add all the Visual Controls needed for the connection properties. Below is a typical connection string:

    Server=ServerName;DBServerType=MSSQL_2016;CompanyDB=SBODemoCA;User=manager;Password=manager;

    To connect to SAP Business One DI data, specify the following connection properties:

    • DBServerType: The type of server being connected to.
    • Server: The name or IP address of the Business One DI server to connect to.
    • CompanyDB: The company to connect to.
    • User: The username used when connecting to the LicenseServer.
    • Password: The password used when connecting to the LicenseServer.
    • LicenseServer (optional): Set this if your License Server is different from the Server.
    • UseTrusted (optional): Set to TRUE to connect using Windows credentials.

  2. Add the DataGrid control from the .NET controls.
  3. Configure the columns of the DataGrid control. Below are several columns from the Account 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=AcctCode}" Header="AcctCode" Width="SizeToHeader" /> ... </DataGrid.Columns> </DataGrid>
  4. Add a reference to the CData ADO.NET Provider for SAP Business One DI assembly.

Connect the DataGrid

Once the visual elements have been configured, you can use standard ADO.NET objects like Connection, Command, and DataAdapter to populate a DataTable with the results of an SQL query:

System.Data.CData.SAPBusinessOneDI.SAPBusinessOneDIConnection conn conn = create System.Data.CData.SAPBusinessOneDI.SAPBusinessOneDIConnection(connectionString) System.Data.CData.SAPBusinessOneDI.SAPBusinessOneDICommand comm comm = create System.Data.CData.SAPBusinessOneDI.SAPBusinessOneDICommand(command, conn) System.Data.DataTable table table = create System.Data.DataTable System.Data.CData.SAPBusinessOneDI.SAPBusinessOneDIDataAdapter dataAdapter dataAdapter = create System.Data.CData.SAPBusinessOneDI.SAPBusinessOneDIDataAdapter(comm) dataAdapter.Fill(table) datagrid1.ItemsSource=table.DefaultView

The code above can be used to bind data from the specified query to the DataGrid.