asp.net.ph

IDataRecord.GetOrdinal Method

System.Data Namespace   IDataRecord 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

IDataRecord Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph