製品をチェック

無償トライアル:

無償トライアルへ

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

Basecamp ADO.NET Provider

Basecamp 連携のパワフルな.NET アプリケーションを高速で開発・配布。

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

お問い合わせ

Basecamp データをDevExpress Data Grid にデータバインドする。


Basecamp 用の CData ADO.NET プロバイダーをDevExpress Windows Forms とWeb コントロールとともに使用し、Basecamp をチャートに入力します。


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

basecamp ロゴ画像

ADO.NET Adapter

ado ロゴ画像
DevExpress ロゴ画像

Basecamp 用の CData ADO.NET プロバイダーはサードパーティーコントロールで使うことのできる通常のADO.NET データベースアクセスコンポーネントを実装しています。データバインドするための通常のADO.NET プロセスに従うことで、UI コントロールから実データへの双方向アクセスを可能にします。 この記事では、CData を使ってDevExpress Windows Forms とウェブコントロールにデータバインドする方法を説明します。ここでは、最新のデータを表示するチャートにデータバインドします。

Basecamp はBasic 認証もしくはOAuth 2.0 認証を使います。Basic 認証を使用するには、Basecamp へのログインに使用するuser およびpassword が必要です。OAuth 2.0 を使用して認証するには、Basecamp にアプリを登録してOAuthClientId、OAuthClientSecret、およびCallbackURL 接続プロパティを取得する必要があります。

詳しくは、ヘルプドキュメントの「はじめに」セクションを参照してください。

さらに、AccountId 接続プロパティを設定する必要があります。これはBasecamp にログイン後にURL で確認できます。

Windows Forms コントロール

下のコードでは、Basecamp でDevExpress のチャートに追加する方法を説明します。BasecampDataAdapter はチャートコントロールのSeries プロパティにバインドします。コントロールのDiagram プロパティはx 軸とy 軸をカラム名として定義します。

using (BasecampConnection connection = new BasecampConnection( "User=test@northwind.db;Password=test123;")) { BasecampDataAdapter dataAdapter = new BasecampDataAdapter( "SELECT Name, DocumentsCount FROM Projects", connection); DataTable table = new DataTable(); dataAdapter.Fill(table); DevExpress.XtraCharts.Series series = new DevExpress.XtraCharts.Series(); chartControl1.Series.Add(series); DataTable table = new DataTable(); series.ValueDataMembers.AddRange(new string[] { "DocumentsCount" }); series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; series.ArgumentDataMember = "Name"; series.ValueScaleType = DevExpress.XtraCharts.ScaleType.Numerical; chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; } The complete code example and the resulting chart.

Web コントロール

下のコードではBasecamp でDevExpress Web を操作するための設定方法を説明します。BasecampDataAdapter はチャートのSeries プロパティにバインドします。Diagram プロパティはx 軸とy 軸をカラム名として定義します。 using DevExpress.XtraCharts; using (BasecampConnection connection = new BasecampConnection( "User=test@northwind.db;Password=test123;")) { BasecampDataAdapter BasecampDataAdapter1 = new BasecampDataAdapter("SELECT Name, DocumentsCount FROM Projects", connection); DataTable table = new DataTable(); BasecampDataAdapter1.Fill(table); DevExpress.XtraCharts.Series series = new Series("Series1", ViewType.Bar); WebChartControl1.Series.Add(series); DataTable table = new DataTable(); series.ValueDataMembers.AddRange(new string[] { "DocumentsCount" }); series.ArgumentScaleType = ScaleType.Qualitative; series.ArgumentDataMember = "Name"; series.ValueScaleType = ScaleType.Numerical; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; } An ASP.NET application created with the ADO.NET Provider and the DevExpress Web Forms control.(Salesforce is shown.)