ADO.NET Provider for Claude Compliance

Build 26.0.9770

Querying with the DataReader

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

Using the ClaudeComplianceDataReader

The ClaudeComplianceDataReader retrieves data faster than the ClaudeComplianceDataAdapter because it can retrieve data in pages. As you read data from the ClaudeComplianceDataReader, it periodically requests the next page of results from the data source, if required. This causes results to be returned at a faster rate. The following example selects all the columns from the Activities table:

C#

string connectionString = "APIKey=sk-ant-api01-your-compliance-access-key;";

using (ClaudeComplianceConnection connection = new ClaudeComplianceConnection(connectionString)) {
  ClaudeComplianceCommand cmd = new ClaudeComplianceCommand("SELECT * FROM Activities", connection);
  
  ClaudeComplianceDataReader rdr = cmd.ExecuteReader();

  while (rdr.Read()) {
    Console.WriteLine(String.Format("\t{0} --> \t\t{1}", rdr["Id"], rdr["Type"]));
  }
}

VB.NET

Dim connectionString As String = "APIKey=sk-ant-api01-your-compliance-access-key;"

Using connection As New ClaudeComplianceConnection(connectionString)
  Dim cmd As New ClaudeComplianceCommand("SELECT * FROM Activities", connection)

  Dim rdr As ClaudeComplianceDataReader = cmd.ExecuteReader()

  While rdr.Read()
    Console.WriteLine([String].Format(vbTab & "{0} --> " & vbTab & vbTab & "{1}", rdr("Id"), rdr("Type")))
  End While
End Using

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