NullableTypes Class Library

DBNullConvert.ToNullableSingle Method 

Converts an object value that is DBNull or System.Single to an equivalent NullableSingle value.

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

Parameters

x
A value of Single 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 NullableSingle constructed from x.

Exceptions

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

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace