DataBind EnterpriseDB Data to the DevExpress Data Grid

Ready to get started?

Download for a free trial:

Download Now

Learn more:

EnterpriseDB ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with EnterpriseDB.



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

The CData ADO.NET Provider for EnterpriseDB 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.

The following connection properties are required in order to connect to data.

  • Server: The host name or IP of the server hosting the EnterpriseDB database.
  • Port: The port of the server hosting the EnterpriseDB database.

You can also optionally set the following:

  • Database: The default database to connect to when connecting to the EnterpriseDB Server. If this is not set, the user's default database will be used.

Connect Using Standard Authentication

To authenticate using standard authentication, set the following:

  • User: The user which will be used to authenticate with the EnterpriseDB server.
  • Password: The password which will be used to authenticate with the EnterpriseDB server.

Connect Using SSL Authentication

You can leverage SSL authentication to connect to EnterpriseDB data via a secure session. Configure the following connection properties to connect to data:

  • SSLClientCert: Set this to the name of the certificate store for the client certificate. Used in the case of 2-way SSL, where truststore and keystore are kept on both the client and server machines.
  • SSLClientCertPassword: If a client certificate store is password-protected, set this value to the store's password.
  • SSLClientCertSubject: The subject of the TLS/SSL client certificate. Used to locate the certificate in the store.
  • SSLClientCertType: The certificate type of the client store.
  • SSLServerCert: The certificate to be accepted from the server.

Windows Forms Controls

The code below shows how to populate a DevExpress chart with EnterpriseDB data. The EnterpriseDBDataAdapter 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 (EnterpriseDBConnection connection = new EnterpriseDBConnection( "User=postgres;Password=admin;Database=postgres;Server=127.0.0.1;Port=5444")) { EnterpriseDBDataAdapter dataAdapter = new EnterpriseDBDataAdapter( "SELECT ShipName, ShipCity FROM Orders WHERE ShipCountry = 'USA'", 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[] { "ShipCity" }); series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; series.ArgumentDataMember = "ShipName"; 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 EnterpriseDB data. The EnterpriseDBDataAdapter 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 (EnterpriseDBConnection connection = new EnterpriseDBConnection( "User=postgres;Password=admin;Database=postgres;Server=127.0.0.1;Port=5444")) { EnterpriseDBDataAdapter EnterpriseDBDataAdapter1 = new EnterpriseDBDataAdapter("SELECT ShipName, ShipCity FROM Orders WHERE ShipCountry = 'USA'", connection); DataTable table = new DataTable(); EnterpriseDBDataAdapter1.Fill(table); DevExpress.XtraCharts.Series series = new Series("Series1", ViewType.Bar); WebChartControl1.Series.Add(series); series.DataSource = table; series.ValueDataMembers.AddRange(new string[] { "ShipCity" }); series.ArgumentScaleType = ScaleType.Qualitative; series.ArgumentDataMember = "ShipName"; series.ValueScaleType = ScaleType.Numerical; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; }