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.

返回

Int32

指定列的值。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.

适用于