Send feedback on this topic.
Teradata.Client.Provider
GetValue Method (TdDataReader)



Teradata.Client.Provider Namespace > TdDataReader Class : GetValue Method
Column ordinal (see TdDataReader.GetOrdinal).
Gets the value of the specified field (column) as an Object.
Syntax
'Declaration
 
Public Overrides NotOverridable Function GetValue( _
   ByVal ordinal As Integer _
) As Object
'Usage
 
Dim instance As TdDataReader
Dim ordinal As Integer
Dim value As Object
 
value = instance.GetValue(ordinal)
public override object GetValue( 
   int ordinal
)
public:
Object^ GetValue( 
   int ordinal
) override 

Parameters

ordinal
Column ordinal (see TdDataReader.GetOrdinal).

Return Value

Returns the value of the specified field represented as a System.Object type.
Exceptions
ExceptionDescription
ordinal is less than zero or ordinal is equal to or greater than TdDataReader.FieldCount or operating in Data.CommandBehavior.SequentialAccess mode and specified column is not accessible.
CommandBehavior is set to SchemaOnly, or there is no data for the row or column, or preceding columns are no longer accessible.
Conversion overflow. For example Teradata DECIMAL(38) might result in Overflow when converted to Decimal.
The TdDataReader is closed.
The Advanced SQL Engine returned an error or .NET Data Provider for Teradata detected an error.
Remarks
GetValue returns a System.Object (It is the root of all types) and therefore is used to retrieve any Teradata data type. The Data Provider maps the Teradata data types to .NET Framework types and returns a reference to the .NET Framework instance.

GetValue is the most flexible field retrieval method and is also the slowest field retrieval method. It is strongly recommended to use the other strongly typed field retrieval methods (for example, GetInt32).

This method does not throw an exception for null database fields. It returns an instance of DBNull.

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