DataReaderExtensions.IsDBNull(DbDataReader, String) 方法

定義

取得值,這個值表示資料行是否包含不存在或遺漏的值。

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsDBNull(System::Data::Common::DbDataReader ^ reader, System::String ^ name);
public static bool IsDBNull (this System.Data.Common.DbDataReader reader, string name);
static member IsDBNull : System.Data.Common.DbDataReader * string -> bool
<Extension()>
Public Function IsDBNull (reader As DbDataReader, name As String) As Boolean

參數

reader
DbDataReader

要從中取得資料行值的資料讀取器。

name
String

資料行名稱。

傳回

如果指定的資料行等於 DBNull,則為 true,否則為 false

例外狀況

指定的名稱不是有效的資料行名稱。

備註

呼叫此方法以在呼叫具型別Get_*_ (方法之前檢查 null 數據行值,例如 、 GetByteGetChar等) 以避免擲回例外狀況。

適用於

另請參閱