GetOracleBoolean(int)

This method will return an OracleBoolean value of the specified column.

Declaration

// C#
public OracleBoolean GetOracleBoolean(int index);

Parameter

index - The zero-based column index.

Return Value

The OracleBoolean value of the column

Exceptions

InvalidOperationException - The connection is closed, the reader is closed, Read() has not been called, or all rows have been read.

IndexOutOfRangeException - The column index is invalid.

InvalidCastException - The accessor method is invalid for this column type.

Remarks

  • This method can be called on the BOOLEAN column, any numeric database type column (NUMBER, BINARY_DOUBLE, BINARY_FLOAT, and FLOAT), or any scalar character based column (CHAR, NCHAR, VARCHAR2, NVARCHAR2)

  • For numeric columns, FALSE is returned if column value is 0; TRUE otherwise.

  • For scalar character based column (CHAR, NCHAR, VARCHAR2, NVARCHAR2), GetBoolean can be called on Valid String literals.

    Valid String literals to represent TRUE and FALSE (case insensitive) are as follows:

    • For TRUE, valid string literals are (case insensitive) - true, yes, on, 1, t, y

    • For FALSE, valid string literals are (case insensitive) - false, no, off, 0, f, n

    If the string literals are anything other than those listed above, then an InvalidCastException will be returned when trying to read the value.

  • IsDBNull should be called to check for NULL values before calling this method.