Skip to main content

IColumn Interface

A schema of a column in a ITable.

Namespace: DevExpress.DataAccess.Sql.DataApi

Assembly: DevExpress.DataAccess.v23.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap


public interface IColumn

The following members return IColumn objects:


For each table, you can access its columns using the ITable.Columns property. This property returns the object implementing the IColumn interface. To obtain the column name and type, use the IColumn.Name and IColumn.Type properties, respectively.


The following example illustrates how to use the SqlDataSource.Result property to extract all data records from an SqlDataSource and pass them to a corresponding DataTable object.

using DevExpress.DataAccess.Sql;
using DevExpress.DataAccess.Sql.DataApi;
using System;
using System.Data;
using System.Linq;
using System.Windows.Forms;
// ...

private void button1_Click(object sender, EventArgs e) {
    XtraReport1 report = new XtraReport1();
    SqlDataSource ds = report.DataSource as SqlDataSource;

    ITable src = ds.Result["Categories"];
    DataTable dest = new DataTable("Categories");
    foreach (IColumn column in src.Columns)
        dest.Columns.Add(column.Name, column.Type);
    foreach (IRow row in src)
See Also