DB2ResultSet.GetDateTime Method

Gets the value of the specified column as a DateTime object.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public Function GetDateTime( _
   ByVal i As Integer _
) As DateTime
[C#]
public DateTime GetDateTime(
   int i
);
[C++]
public: DateTime GetDateTime(
   int i
);
[JScript]
public function GetDateTime(
   i : int
) : DateTime;

Parameters

i
The zero-based column ordinal.

Return value

The value of the specified column as a DateTime object.

Exceptions

Exception type Condition
InvalidCastException The specified cast is not valid.
DB2Exception Invalid conversion.

Remarks

No conversions are performed. The data to be retrieved must be of DB2®Type.Date or DB2Type.Timestamp.

The following table describes the mapping between the return object data type and the data server data type.
DB2Type Data Type Db2® Data Type Informix® Data Type
Date DATE DATETIME (date precision)

Call IsDBNull to check for null values before calling this method.