製品をチェック

無償トライアル:

無償トライアルへ

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

Bullhorn CRM ADO.NET Provider

Bullhorn CRM データに連携する.NET アプリケーションを素早く、簡単に開発できる便利なドライバー。

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

お問い合わせ

Visual Studio でチャートコントロールと Bullhorn CRM をデータバインド


標準ADO.NET プロシージャを使ってデータバインドして、Visual Studio ツールボックスのコントロールから Bullhorn CRM との双方向接続を実現。この記事ではVisual Studio のグラフィカルアプローチと、ほんの数行のコードでデータバインドをする方法を説明します。


加藤龍彦
ウェブデベロッパー

bullhorncrm ロゴ画像

ADO.NET Adapter

ado ロゴ画像
.NET ロゴ画像

データバインドによって、UI コントロールからデータに接続できます。 CData ADO.NET Provider for BullhornCRM を使って、Visual Studio 上でWindows Forms およびWeb Forms とBullhorn CRM をデータバインドできます。この記事で、Bullhorn CRM を、ウィザードから変更をリアルタイムで反映するチャートにデータバインドする方法を説明します。 Code Walk-through セクションではチャートはほんの10行のコードで作成します。

チャートへのデータバインド

データバインドは3つのステップから構成されます;コントロールのインスタンス作成、データソースの設定、データバインドです。

接続を設定してデータベースオブジェクトを選択

下の手続きにより、データソース構成ウィザードを使ってチャートコントロールとBullhorn CRM との接続を作成します。ウィザード上でデータバインドをするBullhorn CRM エンティティを使います。

  1. Windows Forms プロジェクトでは、チャートコントロールをツールボックスからフォーム上にドラグ&ドロップします。チャートプロパティのデータセクションで DataSource を選択し、メニューからプロジェクトデータソースの追加を選択します。 Add a data source to be bound to the chart.
  2. 出てくるデータソース構成ウィザードでデータベース -> データセットを選択します。
  3. データ接続ステップで、「新しい接続」をクリックします。
  4. データ接続の選択ダイアログで、「変更」をクリックして、CData Bullhorn CRM データソースを選択して、接続プロパティを入力します。下は代表的な接続文字列ですです。:

    DataCenterCode=CLS33;OAuthClientId=myoauthclientid;OAuthClientSecret=myoauthclientsecret;

    Begin by providing your Bullhorn CRM account credentials in the following:

    If you are uncertain about your data center code, codes like CLS2, CLS21, etc. are cluster IDs that are contained in a user's browser URL (address bar) once they are logged in.

    Example: https://cls21.bullhornstaffing.com/BullhornSTAFFING/MainFrame.jsp?#no-ba... indicates that the logged in user is on CLS21.

    Authenticating with OAuth

    Bullhorn CRM uses the OAuth 2.0 authentication standard. To authenticate using OAuth, create and configure a custom OAuth app. See the Help documentation for more information.

  5. Connection properties for the selected data source in the Add Connection dialog. (Salesforce is shown.)
  6. 使用するデータソースオブジェクトを選択します。例は Candidate テーブルです。 Select database objects. (Salesforce is shown.)

DataBind

データソースの追加とデータベースオブジェクトを選択したら、チャートにオブジェクトをバインドします。この例では、X軸に Id をY軸に CandidateName を設定します。

  1. チャートプロパティで、Series プロパティをクリックし、Series コレクション エディター を開きます。
  2. Series プロパティでX軸、Y軸に設定するカラムを選択します:XValueMember および YValueMember プロパティにメニューからカラムを選びます。
The axes of the chart defined in the Series Collection Editor.

チャートはこれでBullhorn CRM にデータバインドされました。チャートを実行して最新のデータを表示させましょう。 The chart, filled with data at run time.

コード Walk-through

Bullhorn CRM へのデータバインドはほんの数行のコードのみが必要で、3つの簡単なステップで完了できます。

  1. Bullhorn CRM に接続します。
  2. BullhornCRMDataAdapter を作成して、クエリを作成し、結果を入れるデータセットを作成します。
  3. 結果セットとチャートをデータバインドします。

下に完全なコードを示します:

BullhornCRMConnection conn = new BullhornCRMConnection("DataCenterCode=CLS33;OAuthClientId=myoauthclientid;OAuthClientSecret=myoauthclientsecret;"); BullhornCRMCommand comm = new BullhornCRMCommand("SELECT Id, CandidateName FROM Candidate WHERE CandidateName = 'Jane Doe'", conn); BullhornCRMDataAdapter da = new BullhornCRMDataAdapter(comm); DataSet dataset = new DataSet(); da.Fill(dataset); chart1.DataSource = dataset; chart1.Series[0].XValueMember = "Id"; chart1.Series[0].YValueMembers = "CandidateName"; // Insert code for additional chart formatting here. chart1.DataBind();