ADO.NET Provider for Airtable

Build 21.0.7930

Querying with the DataAdapter

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

Using the AirtableDataAdapter

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 AirtableDataAdapter is slower than the AirtableDataReader because the Fill method needs to retrieve all data from the data source before returning.

The following example selects the Id and Column1 columns of the SampleTable_1 table:


string connectionString = "APIKey=keymz3adb53RqsU;BaseId=appxxN2fe34r3rjdG7;TableNames=TableA,TableB,TableC;ViewNames=TableA.ViewA,TableA.ViewB,..,TableX.ViewY;";

using (AirtableConnection connection = new AirtableConnection(connectionString)) {
  AirtableDataAdapter dataAdapter = new AirtableDataAdapter(
  "SELECT Id, Column1 FROM SampleTable_1", connection);

  DataTable table = new DataTable();

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

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


Dim connectionString As String = "APIKey=keymz3adb53RqsU;BaseId=appxxN2fe34r3rjdG7;TableNames=TableA,TableB,TableC;ViewNames=TableA.ViewA,TableA.ViewB,..,TableX.ViewY;"

Using connection As New AirtableConnection(connectionString)
  Dim dataAdapter As New AirtableDataAdapter("SELECT Id, Column1 FROM SampleTable_1", connection)

  Dim table As New DataTable()

  Console.WriteLine("Contents of SampleTable_1.")

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

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7930