Ready to get started?

Download a free trial of the SAS Data Sets Data Provider to get started:

 Download Now

Learn more:

SAS Data Sets Icon SAS Data Sets ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with SAS Data Sets.

DataBind SAS Data Sets Data to the DevExpress Data Grid



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

The ADO.NET Provider for SAS Data Sets by CData incorporates conventional ADO.NET data access components compatible with third-party controls. You can adhere to the standard ADO.NET data binding procedures to establish two-way access to real-time data through UI controls. This article will demonstrate the utilization of CData components for data binding with DevExpress UI Controls (Windows Forms and Web controls), specifically binding to a chart that visualizes live data.

Set the following connection properties to connect to your SAS DataSet files:

Connecting to Local Files

  • Set the Connection Type to "Local." Local files support SELECT, INSERT, and DELETE commands.
  • Set the URI to a folder containing SAS files, e.g. C:\PATH\TO\FOLDER\.

Connecting to Cloud-Hosted SAS DataSet Files

While the driver is capable of pulling data from SAS DataSet files hosted on a variety of cloud data stores, INSERT, UPDATE, and DELETE are not supported outside of local files in this driver.

Set the Connection Type to the service hosting your SAS DataSet files. A unique prefix at the beginning of the URI connection property is used to identify the cloud data store and the remainder of the path is a relative path to the desired folder (one table per file) or single file (a single table). For more information, refer to the Getting Started section of the Help documentation.

Windows Forms Controls

The code below shows how to populate a DevExpress chart with SAS Data Sets data. The SASDataSetsDataAdapter 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 (SASDataSetsConnection connection = new SASDataSetsConnection( "URI=C:/myfolder;")) { SASDataSetsDataAdapter dataAdapter = new SASDataSetsDataAdapter( "SELECT name, borough FROM restaurants WHERE cuisine = 'American'", 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[] { "borough" }); 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; }

Web Controls

The code below shows how to populate a DevExpress Web control with SAS Data Sets data. The SASDataSetsDataAdapter 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 (SASDataSetsConnection connection = new SASDataSetsConnection( "URI=C:/myfolder;")) { SASDataSetsDataAdapter SASDataSetsDataAdapter1 = new SASDataSetsDataAdapter("SELECT name, borough FROM restaurants WHERE cuisine = 'American'", connection); DataTable table = new DataTable(); SASDataSetsDataAdapter1.Fill(table); DevExpress.XtraCharts.Series series = new Series("Series1", ViewType.Bar); WebChartControl1.Series.Add(series); series.DataSource = table; series.ValueDataMembers.AddRange(new string[] { "borough" }); series.ArgumentScaleType = ScaleType.Qualitative; series.ArgumentDataMember = "name"; series.ValueScaleType = ScaleType.Numerical; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; }