DataReaderExtensions.GetInt32(DbDataReader, String) 方法

定義

取得指定資料行的值作為 32 位元帶正負號的整數。

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

參數

reader
DbDataReader

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

name
String

資料行名稱。

傳回

Int32

指定的資料行值。

例外狀況

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

指定的轉型無效。

適用於

另請參閱