DataBind SAS xpt Data to the DevExpress Data Grid

Ready to get started?

Download for a free trial:

Download Now

Learn more:

SASxpt ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with SAS xpt (XPORT) files data.



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

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

Connecting to Local SASXpt Files

You can connect to local SASXpt file by setting the URI to a folder containing SASXpt files.

Connecting to S3 data source

You can connect to Amazon S3 source to read SASXpt files. Set the following properties to connect:

  • URI: Set this to the folder within your bucket that you would like to connect to.
  • AWSAccessKey: Set this to your AWS account access key.
  • AWSSecretKey: Set this to your AWS account secret key.
  • TemporaryLocalFolder: Set this to the path, or URI, to the folder that is used to temporarily download SASXpt file(s).

Connecting to Azure Data Lake Storage Gen2

You can connect to ADLS Gen2 to read SASXpt files. Set the following properties to connect:

  • URI: Set this to the name of the file system and the name of the folder which contacts your SASXpt files.
  • AzureAccount: Set this to the name of the Azure Data Lake storage account.
  • AzureAccessKey: Set this to our Azure DataLakeStore Gen 2 storage account access key.
  • TemporaryLocalFolder: Set this to the path, or URI, to the folder that is used to temporarily download SASXpt file(s).

Windows Forms Controls

The code below shows how to populate a DevExpress chart with SAS xpt data. The SASXptDataAdapter 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 (SASXptConnection connection = new SASXptConnection( "URI=C:/folder;")) { SASXptDataAdapter dataAdapter = new SASXptDataAdapter( "SELECT Id, Column1 FROM SampleTable_1 WHERE Column2 = '100'", 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[] { "Column1" }); series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.Qualitative; series.ArgumentDataMember = "Id"; 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 xpt data. The SASXptDataAdapter 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 (SASXptConnection connection = new SASXptConnection( "URI=C:/folder;")) { SASXptDataAdapter SASXptDataAdapter1 = new SASXptDataAdapter("SELECT Id, Column1 FROM SampleTable_1 WHERE Column2 = '100'", connection); DataTable table = new DataTable(); SASXptDataAdapter1.Fill(table); DevExpress.XtraCharts.Series series = new Series("Series1", ViewType.Bar); WebChartControl1.Series.Add(series); series.DataSource = table; series.ValueDataMembers.AddRange(new string[] { "Column1" }); series.ArgumentScaleType = ScaleType.Qualitative; series.ArgumentDataMember = "Id"; series.ValueScaleType = ScaleType.Numerical; ((DevExpress.XtraCharts.SideBySideBarSeriesView)series.View).ColorEach = true; }