ADO.NET Provider for Blackbaud Financial Edge NXT

Build 23.0.8839

DataAdapter を使用したクエリ

CData ADO.NET Provider for Blackbaud Financial Edge NXT では、次の2つのネイティブ.NET インターフェースを使用して、Blackbaud Financial Edge NXT からデータを取得できます。FinancialEdgeNXTDataAdapter オブジェクトおよびFinancialEdgeNXTDataReader オブジェクト。各オブジェクトは同じタスク(データの取得)を実行しますが、実行方法が異なります。FinancialEdgeNXTDataAdapter オブジェクトはクエリに一致するすべてのデータを取得しますが、FinancialEdgeNXTDataReader オブジェクトは必要に応じてインクリメントしながら一部のデータだけをフェッチします。

FinancialEdgeNXTDataAdapter の使用

アダプターのFill メソッドを使用して、データソースからデータを取得します。空のDataTable インスタンスがFill メソッドへの引数として渡されます。このメソッドが戻ってきたとき、DataTable インスタンスにはクエリされたデータが設定されています。Fill メソッドは、戻る前にデータソースからすべてのデータを取得する必要があるため、FinancialEdgeNXTDataAdapter はFinancialEdgeNXTDataReader よりも時間がかかります。

次の例は、Accounts テーブルのAccountId カラムとAccountNumber カラムを選択します。

C#

string connectionString = "InitiateOAuth=GETANDREFRESH;SubscriptionKey=MySubscriptionKey;OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;CallbackURL=http://localhost:33333;";

using (FinancialEdgeNXTConnection connection = new FinancialEdgeNXTConnection(connectionString)) {
  FinancialEdgeNXTDataAdapter dataAdapter = new FinancialEdgeNXTDataAdapter(
  "SELECT AccountId, AccountNumber FROM Accounts", connection);

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

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

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

VB.NET

Dim connectionString As String = "InitiateOAuth=GETANDREFRESH;SubscriptionKey=MySubscriptionKey;OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;CallbackURL=http://localhost:33333;"

Using connection As New FinancialEdgeNXTConnection(connectionString)
  Dim dataAdapter As New FinancialEdgeNXTDataAdapter("SELECT AccountId, AccountNumber FROM Accounts", connection)

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

  Console.WriteLine("Contents of Accounts.")

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

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839