製品をチェック

無償トライアル:

無償トライアルへ

製品の情報と無償トライアルへ:

ADP ADO.NET Provider

ADP 連携のパワフルな.NET アプリケーションを素早く作成して配布。

データ連携でお困りですか?

お問い合わせ

PowerBuilder からADP データに接続してみた


この記事ではCData ADO.NET Provider for ADP を使ってPowerBuilder からADP にアクセスする方法を説明します。


adp ロゴ画像
ado ロゴ画像

ADO.NET

PowerBuilder

CData ADO.NET providers は、PowerBuilder を含むMicrosoft .NET をサポートするあらゆるプラットフォームまたは開発テクノロジーから使用できる、使いやすい標準準拠のデータプロバイダーです。 この記事では、CData ADO.NET Provider for ADP をPowerBuilder で使う方法について説明します。

CData ADO.NET Provider for ADP を使ってデータを取得し読み書きを実行する基本的なPowerBuilder アプリケーションを作成する方法について説明します。

  1. 新規WPF Window Application ソリューションで、接続プロパティに必要なすべてのビジュアルコントロールを追加します。一般的な接続文字列は次のとおりです:

    OAuthClientId=YourClientId;OAuthClientSecret=YourClientSecret;SSLClientCert='c:\cert.pfx';SSLClientCertPassword='admin@123'InitiateOAuth=GETANDREFRESH

    Connect to ADP by specifying the following properties:

    • SSLClientCert: Set this to the certificate provided during registration.
    • SSLClientCertPassword: Set this to the password of the certificate.
    • UseUAT: The connector makes requests to the production environment by default. If using a developer account, set UseUAT = true.
    • RowScanDepth: The maximum number of rows to scan for the custom fields columns available in the table. The default value will be set to 100. Setting a high value may decrease performance.

    The connector uses OAuth to authenticate with ADP. OAuth requires the authenticating user to interact with ADP using the browser. For more information, refer to the OAuth section in the Help documentation.

  2. .NET コントロールからDataGrid コントロールを追加します。
  3. DataGrid コントロールのカラムを設定します。Account テーブルからいくつかのカラムを以下に示します: <DataGrid AutoGenerateColumns="False" Margin="13,249,12,14" Name="datagrid1" TabIndex="70" ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" /> <DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=AssociateOID}" Header="AssociateOID" Width="SizeToHeader" /> ... </DataGrid.Columns> </DataGrid>
  4. CData ADO.NET Provider for ADP アセンブリへの参照を追加します。

DataGrid 接続

ビジュアルエレメントが設定されたら、Connection、Command、およびDataAdapter のような標準のADO.NET オブジェクトを使ってSQL クエリの結果をDataTable に表示することができます:

System.Data.CData.ADP.ADPConnection conn conn = create System.Data.CData.ADP.ADPConnection(connectionString) System.Data.CData.ADP.ADPCommand comm comm = create System.Data.CData.ADP.ADPCommand(command, conn) System.Data.DataTable table table = create System.Data.DataTable System.Data.CData.ADP.ADPDataAdapter dataAdapter dataAdapter = create System.Data.CData.ADP.ADPDataAdapter(comm) dataAdapter.Fill(table) datagrid1.ItemsSource=table.DefaultView

上のコードは、指定したクエリからDataGrid にデータをバインドできます。