今すぐお試しください!

製品の詳細CData ADO.NET Provider for Lohaco を確認して、無償評価版をダウンロード:

今すぐダウンロード

DataBind Lohaco Data to the DevExpress Data Grid

Use the CData ADO.NET Provider for Lohaco with the DevExpress Windows Forms and Web controls to provide Lohaco data to a chart.

The CData ADO.NET Provider for Lohaco implements standard ADO.NET data access components that can be used with third-party controls. The standard ADO.NET process for databinding can be followed to enable bidirectional access to live data from UI controls. In this article we show how to use the CData components to databind to the DevExpress Windows Forms and Web controls; you will databind to a chart that displays current data.

Lohaco に接続する場合は、 SellerId、SSLClientCert、およびSSLClientCertType が必要です。

Lohaco へのアクセスの設定

SellerId、SSLClientCert、およびSSLClientCertType を取得するには、以下の手順に従ってください。

  • 「API 認証について」を参照して公開鍵と秘密鍵を生成します。
  • Lohaco ストアクリエイターにログインして、[設定]メニューの[証明書設定]に移動します。
  • [証明書を登録]をクリックして[公開鍵]、[許可IPアドレス]、[有効期限]を入力します。

Lohaco アカウントの認証

次の接続プロパティを設定して接続します。

  • SellerId:接続先のLohaco Store ID を設定。
  • SSLClientCert:プライベートキーのファイルパスを設定。
  • SSLClientCertType:値"PEMKEY_FILE" を設定。

Windows Forms Controls

The code below shows how to populate a DevExpress chart with Lohaco data. The LohacoDataAdapter binds to the Series property of the chart control. The Diagram property of the control defines the x- and y-axes as the column names.

using (LohacoConnection connection = new LohacoConnection( "SellerId=MySellerId;SSlClientCert=C:\private.pem;SSLClientCertType=PEMKEY_FILE;")) { LohacoDataAdapter dataAdapter = new LohacoDataAdapter( "SELECT ItemCd, Price FROM Items", connection); DataTable table = new DataTable(); dataAdapter.Fill(table); DevExpress.XtraCharts.Series series = new DevExpress.XtraCharts.Series(); chartControl1.Series.Add(series); series.DataSource = table; series.ValueDataMembers.AddRange(new string[] { "Price" }); series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; series.ArgumentDataMember = "ItemCd"; series.ValueScaleType = DevExpress.XtraCharts.ScaleType.Numerical; chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; }

Web Controls

The code below shows how to populate a DevExpress Web control with Lohaco data. The LohacoDataAdapter binds to the Series property of the chart; the Diagram property defines the x- and y-axes as the column names.

using DevExpress.XtraCharts; using (LohacoConnection connection = new LohacoConnection( "SellerId=MySellerId;SSlClientCert=C:\private.pem;SSLClientCertType=PEMKEY_FILE;")) { LohacoDataAdapter LohacoDataAdapter1 = new LohacoDataAdapter("SELECT ItemCd, Price FROM Items", connection); DataTable table = new DataTable(); LohacoDataAdapter1.Fill(table); DevExpress.XtraCharts.Series series = new Series("Series1", ViewType.Bar); WebChartControl1.Series.Add(series); series.DataSource = table; series.ValueDataMembers.AddRange(new string[] { "Price" }); series.ArgumentScaleType = ScaleType.Qualitative; series.ArgumentDataMember = "ItemCd"; series.ValueScaleType = ScaleType.Numerical; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; }
 
 
ダウンロード