ADO.NET Provider for Pipedrive

Build 23.0.8839

DataAdapter を使用したクエリ

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

PipedriveDataAdapter の使用

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

次の例は、Deals テーブルのId カラムとUserEmail カラムを選択します。

C#

string connectionString = "AuthScheme=Basic;CompanyDomain=MyCompanyDomain;APIToken=MyAPIToken;";

using (PipedriveConnection connection = new PipedriveConnection(connectionString)) {
  PipedriveDataAdapter dataAdapter = new PipedriveDataAdapter(
  "SELECT Id, UserEmail FROM Deals", connection);

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

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

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

VB.NET

Dim connectionString As String = "AuthScheme=Basic;CompanyDomain=MyCompanyDomain;APIToken=MyAPIToken;"

Using connection As New PipedriveConnection(connectionString)
  Dim dataAdapter As New PipedriveDataAdapter("SELECT Id, UserEmail FROM Deals", connection)

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

  Console.WriteLine("Contents of Deals.")

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

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