asp.net.ph

DataColumnCollection.Item Property

System.Data Namespace   DataColumnCollection Class


Returns the specified DataColumn from the collection.

Overload List

1. Returns the DataColumn at the specified index in the collection.

2. Returns the DataColumn from the collection with the specified name.


Example

The following example uses the Item property to print the DataType value of a DataColumn object specified by name.

NOTE: This example shows how to use one of the overloaded versions of the Item property ( DataColumnCollection indexer ). For other examples that may be available, see the individual overload topics.

private void PrintDataType ( DataTable dt ) {
   // get the DataColumnCollection from a DataTable in a DataSet.
   DataColumnCollection cols = dt.Columns;
   // print the column's data type.
   Response.Write ( cols [ "Totals" ].DataType );
}
See Also

DataColumnCollection Members 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