NullableTypes Class Library

DBNullConvert.ToNullableBoolean Method 

Converts an object value that is DBNull or System.Boolean to an equivalent NullableBoolean value.

[Visual Basic]
Public Shared Function ToNullableBoolean( _
   ByVal x As Object _
) As NullableBoolean
[C#]
public static NullableBoolean ToNullableBoolean(
   object x
);

Parameters

x
A value of Boolean type from either a DataRow Item value, a Parameters Item value or a IDataRecord GetValue returned value.

Return Value

Null if x is DBNull otherwise a NullableBoolean constructed from x.

Exceptions

Exception TypeCondition
ArgumentNullExceptionx is null.
InvalidCastExceptionx is neither DBNull or of type Boolean.

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace