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
- name
- The name of the column.
The zero-based column ordinal.
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.
OleDbDataReader Members