DbDataReader.IsDBNull(Int32) 方法
定义
在派生类中重写时,获取一个值,该值指示列中是否包含不存在或丢失的值。When overridden in a derived class, gets a value that indicates whether the column contains nonexistent or missing values.
public:
abstract bool IsDBNull(int ordinal);
public abstract bool IsDBNull (int ordinal);
abstract member IsDBNull : int -> bool
Public MustOverride Function IsDBNull (ordinal As Integer) As Boolean
参数
- ordinal
- Int32
从零开始的列序号。The zero-based column ordinal.
返回
如果指定的列与 DBNull 等效,则为 true;否则,为 false。true if the specified column is equivalent to DBNull; otherwise, false.
实现
例外
列索引超出范围。The column index is out of range.
注解
调用此方法可在调用类型化 Get_ * _ 方法之前检查是否有空列值 (例如,、等 GetByte GetChar) 避免引发异常。Call this method to check for null column values before calling the typed Get_*_ methods (for example, GetByte, GetChar, and so on) to avoid throwing an exception.