asp.net.ph

DataColumnCollection.Item Property ( String )

System.Data Namespace   DataColumnCollection Class


Returns the DataColumn from the collection with the specified name.

Syntax


DataColumn variable = DataColumnCollection.Item [ name ];
... or ...
DataColumn variable = DataColumnCollection [ name ];
  C# VB JScript

Parameters

name
The name of the column to return.

Property Value

The DataColumn in the collection with the specified ColumnName.

Remarks

The Item property is not case-sensitive when searching for column names.

Example

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

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   DataColumnCollection.Item Overload List   ColumnName   Contains   DataColumn 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