Export (0) Print
Expand All

DataColumn.Table Property

Gets the DataTable to which the column belongs to.

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

[BrowsableAttribute(false)]
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft