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



Teradata.Client.Provider Namespace > TdDataReader Class : GetValues Method
An array of System.Object.
Gets the value of the specified field (column) as an Object.
Syntax
'Declaration
 
Public Overrides NotOverridable Function GetValues( _
   ByVal values() As Object _
) As Integer
'Usage
 
Dim instance As TdDataReader
Dim values() As Object
Dim value As Integer
 
value = instance.GetValues(values)
public override int GetValues( 
   object[] values
)
public:
int GetValues( 
   array<Object^>^ values
) override 

Parameters

values
An array of System.Object.

Return Value

Returns the number of fields returned using the object array (values).
Exceptions
ExceptionDescription
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.
The Advanced SQL Engine returned an error, or .NET Data Provider for Teradata detected an error.
Remarks
GetValues is used to retrieve the first N fields where N is less than or equal to the number of columns.

System.Object is the root of all types and therefore can be used to retrieve any Teradata data type. The Data Provider maps the Teradata data types to .NET Framework types and returns references to the .NET Framework instance.

GetValues is the most flexible field retrieval method. However all value types (for example, Int32) are boxed which results in higher resource utilization and are subject to garbage collection.

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

GetValues supports sequential access by simply returning the remaining fields. It returns values for fields M through N where M is the last field retrieved plus one and N is either number of fields or the length of values, whichever is smaller. For example it would return values for fields 2 through 5 if the first field was already retrieved and there are 5 columns per row.

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