System.Data.SqlClient.SqlDataReader.IsDBNull Method

Gets a value that indicates whether the column contains non-existent or missing values.

Syntax

public override bool IsDBNull (int i)

Parameters

i
The zero-based column ordinal.

Returns

true if the specified column value is equivalent to DBNull; otherwise false.

Remarks

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

code reference: SqlDataReader_IsDbNull#1

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0