SqlDataReader.GetInt32(Int32) 方法

定義

從指定的資料行取得 32 位元帶正負號整數形式的值。Gets the value of the specified column as a 32-bit signed integer.

public:
 override int GetInt32(int i);
public:
 virtual int GetInt32(int i);
public override int GetInt32 (int i);
public int GetInt32 (int i);
override this.GetInt32 : int -> int
abstract member GetInt32 : int -> int
override this.GetInt32 : int -> int
Public Overrides Function GetInt32 (i As Integer) As Integer
Public Function GetInt32 (i As Integer) As Integer

參數

i
Int32

以零為基底的資料行序數。The zero-based column ordinal.

傳回

指定之資料行的值。The value of the specified column.

實作

例外狀況

指定的轉型無效。The specified cast is not valid.

備註

不會執行任何轉換;因此,抓取的資料必須已經是32位帶正負號的整數。No conversions are performed; therefore, the data retrieved must already be a 32-bit signed integer.

呼叫 IsDBNull 在呼叫這個方法之前,先檢查是否有 null 值。Call IsDBNull to check for null values before calling this method.

適用於

另請參閱