OleDbDataReader.IsDBNull(Int32) 方法

定义

获取一个值,该值指示列中是否包含不存在或丢失的值。Gets a value that indicates whether the column contains nonexistent or missing values.

public:
 virtual bool IsDBNull(int ordinal);
public bool IsDBNull (int ordinal);
override this.IsDBNull : int -> bool
Public Function IsDBNull (ordinal As Integer) As Boolean

参数

ordinal
Int32

从零开始的列序号。The zero-based column ordinal.

返回

如果指定的列值与 DBNull 等效,则为 true;否则为 falsetrue if the specified column value is equivalent to DBNull; otherwise, false.

注解

调用此方法可在调用类型化 get 方法之前(例如GetByte GetChar,、等)查找空列值,以避免引发错误。Call this method to look for null column values before calling the typed get methods (for example, GetByte, GetChar, and so on) to avoid raising an error.

适用于

另请参阅