ADO.NET Provider for SAP Business Warehouse

Build 26.0.9655

Querying with the DataAdapter

The CData ADO.NET Provider for SAP Business Warehouse implements two ADO.NET interfaces you can use to retrieve data from SAP Business Warehouse: SAPBUSINESSWAREHOUSEDataAdapter and SAPBUSINESSWAREHOUSEDataReader objects. Whereas SAPBUSINESSWAREHOUSEDataAdapter objects retrieve a single result set of all the data that matches a query, SAPBUSINESSWAREHOUSEDataReader objects fetch data in subset increments as needed.

Using the SAPBUSINESSWAREHOUSEDataAdapter

Use the adapter's Fill method to retrieve data from the data source. An empty DataTable instance is passed as an argument to the Fill method. When the method returns, the DataTable instance is populated with the queried data. Note that the SAPBUSINESSWAREHOUSEDataAdapter is slower than the SAPBUSINESSWAREHOUSEDataReader because the Fill method needs to retrieve all data from the data source before returning.

The following example selects the Country and Education columns of the Customer table:

C#

string connectionString = "User=myuseraccount;Password=mypassword;URL=http://localhost:8000/sap/bw/xml/soap/xmla;";

using (SAPBUSINESSWAREHOUSEConnection connection = new SAPBUSINESSWAREHOUSEConnection(connectionString)) {
  SAPBUSINESSWAREHOUSEDataAdapter dataAdapter = new SAPBUSINESSWAREHOUSEDataAdapter(
  "SELECT Country, Education FROM [2CREPM_DEPSOV3].[2CREPM_DEPSOV3/2CREPM_DEPSOQV3].Customer", connection);

  DataTable table = new DataTable();
  dataAdapter.Fill(table);

  Console.WriteLine("Contents of Customer.");

  foreach (DataRow row in table.Rows) {
    Console.WriteLine("{0}: {1}", row["Country"], row["Education"]);
  }
}

VB.NET

Dim connectionString As String = "User=myuseraccount;Password=mypassword;URL=http://localhost:8000/sap/bw/xml/soap/xmla;"

Using connection As New SAPBUSINESSWAREHOUSEConnection(connectionString)
  Dim dataAdapter As New SAPBUSINESSWAREHOUSEDataAdapter("SELECT Country, Education FROM [2CREPM_DEPSOV3].[2CREPM_DEPSOV3/2CREPM_DEPSOQV3].Customer", connection)

  Dim table As New DataTable()
  dataAdapter.Fill(table)

  Console.WriteLine("Contents of Customer.")

  For Each row As DataRow In table.Rows
    Console.WriteLine("{0}: {1}", row("Country"), row("Education"))
  Next
End Using

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9655