DB2ResultSet.GetChar Method

Gets the value of the specified column as a character.

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

Syntax


[Visual Basic]
Public Function GetChar( _
   ByVal i As Integer _
) As Char
[C#]
public char GetChar(
   int i
);
[C++]
public: __wchar_t GetChar(
   int i
);
[JScript]
public function GetChar(
   i : int
) : Char;

Parameters

i
The zero-based column ordinal.

Return value

The value of the specified column as a character.

Exceptions

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

Remarks

When RetrieveXmlInBinaryFormat is set to true, this method will throw an InvalidCastException.

No conversions are performed. The data to be retrieved must be one of the following types:
  • DB2®Type.Char
  • DB2Type.VarChar
  • DB2Type.LongVarChar
  • DB2Type.Clob
  • DB2Type.Graphic
  • DB2Type.VarGraphic
  • DB2Type.LongVarGraphic
  • DB2Type.DbClob
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
Char CHAR CHAR
VarChar VARCHAR VARCHAR
LongVarChar LONG VARCHAR LVARCHAR
Clob CLOB CLOB, TEXT
Graphic GRAPHIC  
VarGraphic VARGRAPHIC  
LongVarGraphic LONG VARGRAPHIC  
DbClob DBCLOB  

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