IDataReader.GetOrdinal(String) Method
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.
Return the index of the named field.
public:
int GetOrdinal(System::String ^ fieldName);
public int GetOrdinal (string fieldName);
abstract member GetOrdinal : string -> int
Public Function GetOrdinal (fieldName As String) As Integer
Parameters
- fieldName
- String
The name of the field to find.
Returns
The index of the named field.
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.