NullableTypes Class Library

DBNullConvert.ToNullableInt64 Method 

Converts an object value that is DBNull or System.Int64 to an equivalent NullableInt64 value.

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

Parameters

x
A value of Int64 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 NullableInt64 constructed from x.

Exceptions

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

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace