- ODBC Drivers
- Java JDBC Drivers
- ADO.NET Providers
- SQL SSIS Components
- BizTalk Adapters
- Excel Add-Ins
- Power BI Connectors
- Tableau Connectors
- PowerShell Cmdlets
- Delphi & C++Builder
- Data Sync
- API Server
PowerBuilder からXero WorkflowMax データに接続してみた
この記事ではCData ADO.NET Provider for Xero WorkflowMax を使ってPowerBuilder からXero WorkflowMax にアクセスする方法を説明します。CData ADO.NET providers は、PowerBuilder を含むMicrosoft .NET をサポートするあらゆるプラットフォームまたは開発テクノロジーから使用できる、使いやすい標準準拠のデータプロバイダーです。 この記事では、CData ADO.NET Provider for Xero WorkflowMax をPowerBuilder で使う方法について説明します。
CData ADO.NET Provider for Xero WorkflowMax を使ってデータを取得し読み書きを実行する基本的なPowerBuilder アプリケーションを作成する方法について説明します。
- 新規WPF Window Application ソリューションで、接続プロパティに必要なすべてのビジュアルコントロールを追加します。一般的な接続文字列は次のとおりです:
APIKey=myApiKey;AccountKey=myAccountKey;
To connect to the WorkflowMax API, obtain an APIKey and AccountKey from Xero. This can only be done by contacting Xero support (https://www.workflowmax.com/contact-us).
After obtaining an API Key and Account Key, set the values in the APIKey and AccountKey connection properties. Once these are set, you are ready to connect.
- .NET コントロールからDataGrid コントロールを追加します。
-
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=Id}" Header="Id" Width="SizeToHeader" /> ... </DataGrid.Columns> </DataGrid>
- CData ADO.NET Provider for Xero WorkflowMax アセンブリへの参照を追加します。
DataGrid 接続
ビジュアルエレメントが設定されたら、Connection、Command、およびDataAdapter のような標準のADO.NET オブジェクトを使ってSQL クエリの結果をDataTable に表示することができます:
System.Data.CData.XeroWorkflowMax.XeroWorkflowMaxConnection conn
conn = create System.Data.CData.XeroWorkflowMax.XeroWorkflowMaxConnection(connectionString)
System.Data.CData.XeroWorkflowMax.XeroWorkflowMaxCommand comm
comm = create System.Data.CData.XeroWorkflowMax.XeroWorkflowMaxCommand(command, conn)
System.Data.DataTable table
table = create System.Data.DataTable
System.Data.CData.XeroWorkflowMax.XeroWorkflowMaxDataAdapter dataAdapter
dataAdapter = create System.Data.CData.XeroWorkflowMax.XeroWorkflowMaxDataAdapter(comm)
dataAdapter.Fill(table)
datagrid1.ItemsSource=table.DefaultView
上のコードは、指定したクエリからDataGrid にデータをバインドできます。