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
public static NullableSingle ToNullableSingle(
   object 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.


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

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace