Send feedback on this topic.
Teradata.Client.Provider
GetValue<T> Method (TdParameter)



Teradata.Client.Provider Namespace > TdParameter Class : GetValue<T> Method
The data type of the value to be returned.
Gets the value of the specified OUT parameter, converted to the requested type, if necessary.
Syntax
'Declaration
 
Public Function GetValue(Of T)() As T
'Usage
 
Dim instance As TdParameter
Dim value As T
 
value = instance.GetValue(Of T)()
public T GetValue<T>()
public:
T^ GetValuegeneric<typename T>
(); 

Type Parameters

T
The data type of the value to be returned.

Return Value

Returns the value of the parameter represented as a T type.
Exceptions
ExceptionDescription
The parameter is not an output parameter, type T is not a supported type for GetValue, or the internal TdDataReader is closed.
This parameter type can not be cast to type T, or the output value is DBNull for a type that does not support nulls.
The parameter value is too large to be cast to type T.
The parameter value is not in the correct format for type T.
The .NET Data Provider detected an error.
Remarks
Supported types:
               Int16    Int32    Int64       Decimal    Double    Single
               Byte     Char     Byte[]      Char[]     DateTime  TimeSpan      
               String   Stream   TextReader  XmlReader  DateTimeOffset 
               
               Plus all Teradata provider specific types (TPST)
            

NOTE: In order to avoid a potential InvalidCastException call TdParameter.IsDBNull before calling this function. This is not required if T is a TPST since all TPST types support null values through their own IsNull() method.

LOB output parameters maintain their own state, which includes the position within the LOB. The data reader is not able to reset the position to the start of a LOB so you must only call one of the following Properties or Methods, one time:

Requirements

Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

See Also

Reference

TdParameter Class
TdParameter Members