asp.net.ph

OleDbDataReader.GetOrdinal Method

System.Data.OleDb Namespace   OleDbDataReader Class


Returns the column ordinal, given the name of the column.

[ VB ]
NotOverridable Public Function GetOrdinal ( _
   ByVal name As String _
) As Integer

[ C# ]
public int GetOrdinal (
   string name
);

[ C++ ]
public: __sealed int GetOrdinal (
   String* name
);

[ JScript ]
public function GetOrdinal (
   name : String
) : int

Parameters

name
The name of the column.

Return Value

The zero-based column ordinal.

Exceptions


Exception Type Condition
IndexOutOfRangeException Occurs when the specified cast is not valid.

Remarks

GetOrdinal performs a case-sensitive lookup first. If it fails, a second case-insensitive search is made.

GetOrdinal is kana-width insensitive.

Because ordinal-based lookups are more efficient than named lookups, it is inefficient to call GetOrdinal within a loop. Save time by calling GetOrdinal once and assigning the results to an integer variable for use within the loop.

See Also

OleDbDataReader Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note