System.Data Namespace DataColumn Class
Returns the DataTable to which the column belongs to.
Script |
DataColumn.Table = strTableName |
The property is read only with no default value.
The following example returns the parent table of a DataColumn through its Table property.
private void GetTable ( DataColumn myColumn ) {
// get the Table of the column.
DataTable myTable = myColumn.Table;
Response.Write ( "columns count: " + myTable.Columns.Count );
Response.Write ( "rows count: " + myTable.Rows.Count );
}
Private Sub GetTable ( ByVal myColumn As DataColumn )
' get the Table of the column.
Dim myTable As DataTable = myColumn.Table
Response.Write ( "columns", myTable.Columns.Count )
Response.Write ( "rows", myTable.Rows.Count )
End Sub |
|
C# |
VB |
DataColumn Members DataTable