IsDBNull method

Returns a value indicating whether the column contains NULL values.

Syntax
Visual Basic

Public Overrides Function IsDBNull( _
   ByVal ordinal As Integer _
) As Boolean
C#

public override bool IsDBNull(
   int ordinal
);
Parameters
  • ordinal   The zero-based column ordinal.

Return value

Returns true if the specified column value is equivalent to DBNull. Otherwise, it returns false.

Remarks

Call this method to check for NULL column values before calling the typed get methods (for example, GetByte, GetChar, and so on) to avoid raising an exception.

See also