Send feedback on this topic.
Teradata.Client.Provider
GetOrdinal Method



Teradata.Client.Provider Namespace > TdDataReader Class : GetOrdinal Method
The name of the column.
Gets the index of the specified column.
Syntax
'Declaration
 
Public Overrides NotOverridable Function GetOrdinal( _
   ByVal name As String _
) As Integer
'Usage
 
Dim instance As TdDataReader
Dim name As String
Dim value As Integer
 
value = instance.GetOrdinal(name)
public override int GetOrdinal( 
   string name
)
public:
int GetOrdinal( 
   String^ name
) override 

Parameters

name
The name of the column.

Return Value

Returns the index of the named column.
Exceptions
ExceptionDescription
namedoes not match any of the columns in TdDataReader.
CommandBehavior is set to SchemaOnly, or there is no data for the row or column, or preceding columns are no longer accessible.
The TdDataReader is closed.
Remarks
GetOrdinal returns the ordinal (the index of the array) of the specified column. See IDataRecord.GetOrdinal for string comparison rules (case sensitive / insensitive). Since column names might not be unique, the ordinal of first matching column is returned.
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdDataReader Class
TdDataReader Members