OdbcDataReader::GetOrdinal Method (String^)
.NET Framework (current version)
Gets the column ordinal, given the name of the column.
Assembly: System.Data (in System.Data.dll)
Parameters
- value
-
Type:
System::String^
The name of the column.
Implements
IDataRecord::GetOrdinal(String^)GetOrdinal performs a case-sensitive lookup first. If it fails, a second case-insensitive search is made. The method throws an IndexOutOfRange exception if the zero-based column ordinal is not found.
GetOrdinal is kana-width insensitive.
Because ordinal-based lookups are more efficient than named lookups, it is inefficient to call GetOrdinal within a loop. Instead, call GetOrdinal one time and then assign the results to an integer variable for use within the loop.
.NET Framework
Available since 1.1
Available since 1.1
GetName
OdbcDataReader Class
System.Data.Odbc Namespace
Working with DataReaders
Show: