[To be supplied.]
[C#] In C#, this member is the indexer for the ColumnsCollection class.
Gets the column from the collection at the specified index.
[Visual Basic] Overloads Overridable Public Default ReadOnly Property Item(Integer) As DataColumn
[C#] public DataColumn this[int] {virtual get;}
[C++] public: __property virtual DataColumn* get_Item(int);
[JScript] ColumnsCollection.Item (int)
Gets the column from the collection with the specified name.
[Visual Basic] Overloads Overridable Public Default ReadOnly Property Item(String) As DataColumn
[C#] public DataColumn this[String] {virtual get;}
[C++] public: __property virtual DataColumn* get_Item(String*);
[JScript] ColumnsCollection.Item (String)
The following example uses the Item property (ColumnsCollection indexer) to print the DataType value of a DataColumn object specified by index.
Note This example shows how to use one of the overloaded versions of the Item property (ColumnsCollection indexer). For other examples that may be available, see the individual overload topics.
[Visual Basic]
Dim cols As DataColumns ' Get the ColumnsCollection from a DataTable in a DataSet. cols = DataSet1.Tables("Orders").Columns ' Print the DataType of the column named "id." Console.WriteLine(cols("id").DataType.ToString)
ColumnsCollection Class | ColumnsCollection Members | System.Data Namespace