System.Data Namespace DataColumn Class
Returns the position of the column in the DataColumnCollection.
Script |
DataColumn.Ordinal = intIndexar |
intIndexar |
The position of the column. Gets -1 if the column is not a member of a collection. |
The property is read only with no default value.
The following example returns the column name, ordinal, and data type of a column.
private void PrintColumnDetails ( DataColumn myColumn ) {
// print the Ordinal, ColumnName, and DataType of the column.
Response.Write ( myColumn.Ordinal );
Response.Write ( myColumn.ColumnName );
Response.Write ( myColumn.DataType );
}
Private Sub PrintColumnDetails ( ByVal myColumn As DataColumn )
' Print the Ordinal, ColumnName, and DataType of the column.
Response.Write ( myColumn.Ordinal )
Response.Write ( myColumn.ColumnName )
Response.Write ( myColumn.DataType )
End Sub |
|
C# |
VB |
DataColumn Members