DB2®DataReader.GetBoolean Method
Retrieves a Boolean value from a specified table column of Boolean data type.
Important: This method is
supported by Db2® 11.1.1 and later
and Db2 for i 7.5
server and later, both of which support the boolean data type.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Function GetBoolean( _
ByVal i As Integer _
) As Boolean
[C#]
public bool GetBoolean(
int i
);
[C++]
public: bool GetBoolean(
int i
);
[JScript]
public function GetBoolean(
i : int
) : Boolean;
Parameters
- i
- The zero-based column ordinal.
Return value
A Boolean that is the value of the column.
Exceptions
Exception type | Condition |
---|---|
InvalidCastException | The specified cast is not valid. |
DB2Exception | Invalid conversion. |
System.InvalidOperationException | Column data type is not supported |
Remarks
Call IsDBNull to check for null values before calling this method.