asp.net.ph

DataRow.Table Property

System.Data Namespace   DataRow Class


Returns the DataTable in which this row has a schema.

Syntax


Script [ DataTable variable = ] DataRow.Table

Property Values


variable The DataTable in which this row belongs.

The property is read only with no default value.

Remarks

A DataRow does not necessarily have to belong to any table's collection of rows. This can occur when the DataRow has been created but not added to the DataRowCollection. If the RowState property returns DataRowState.Detached, the row is not in any collection.

Example

The following example uses the Table property to return a reference to the columns collection of the DataTable.

private void GetTable ( DataRow myRow ) {
   // get the DataTable of a DataRow
   DataTable myTable = myRow.Table;

   // print the DataType of each column in the table.
   foreach ( DataColumn col in myTable ) {
      Response.Write ( col.DataType );
   }
}
  C# VB

See Also

DataRow Members   ColumnsCollection   DataTable Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph