NullableTypes Class Library

DBNullConvert.ToNullableDouble Method 

Converts an object value that is DBNull or System.Double to an equivalent NullableDouble value.

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

Parameters

x
A value of Double 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 NullableDouble constructed from x.

Exceptions

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

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace