Table Property

DataColumn.Table Property


Gets the DataTable to which the column belongs to.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

public DataTable Table { get; }

Property Value

Type: System.Data.DataTable

The DataTable that the DataColumn belongs to.

The following example returns the parent table of a DataColumn through its Table property.

private void GetTable(DataColumn column)
    // Get the Table of the column.
    DataTable table = column.Table;
    Console.WriteLine("columns count: " + table.Columns.Count);
    Console.WriteLine("rows count: " + table.Rows.Count);

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft