DataColumn.Ordinal Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the (zero-based) position of the column in the DataColumnCollection collection.
public:
property int Ordinal { int get(); };
[System.ComponentModel.Browsable(false)]
public int Ordinal { get; }
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("DataColumnOrdinalDescr")]
public int Ordinal { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Ordinal : int
[<System.ComponentModel.Browsable(false)>]
[<System.Data.DataSysDescription("DataColumnOrdinalDescr")>]
member this.Ordinal : int
Public ReadOnly Property Ordinal As Integer
Property Value
The position of the column. Gets -1 if the column is not a member of a collection.
- Attributes
Examples
The following example returns the column name, ordinal, and data type of a column.
private void PrintColumnDetails(DataColumn column)
{
// Print the Ordinal, ColumnName, and
// DataType of the column.
Console.WriteLine(column.Ordinal);
Console.WriteLine(column.ColumnName);
Console.WriteLine(column.DataType);
}
Private Sub PrintColumnDetails(ByVal column As DataColumn)
' Print the Ordinal, ColumnName, and
' DataType of the column.
Console.WriteLine(column.Ordinal)
Console.WriteLine(column.ColumnName)
Console.WriteLine(column.DataType)
End Sub
Applies to
See also
Tee yhteistyötä kanssamme GitHubissa
Tämän sisällön lähde on GitHubissa, jossa voit myös luoda ja tarkastella ongelmia ja pull-pyyntöjä. Katso lisätietoja osallistujan oppaasta.