NullableTypes Class Library

DBNullConvert.ToNullableByte Method 

Converts an object value that is DBNull or System.Byte to an equivalent NullableByte value.

[Visual Basic]
Public Shared Function ToNullableByte( _
   ByVal x As Object _
) As NullableByte
public static NullableByte ToNullableByte(
   object x


A value of Byte 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 NullableByte constructed from x.


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

See Also

DBNullConvert Class | NullableTypes.HelperFunctions Namespace