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
public static NullableBoolean ToNullableBoolean(
   object 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.


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

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace