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
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.