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
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.