SqlDataReader.GetInt16(Int32) 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取指定列的 16 位有符号整数形式的值。
public:
 override short GetInt16(int i);public:
 virtual short GetInt16(int i);public override short GetInt16(int i);public short GetInt16(int i);override this.GetInt16 : int -> int16abstract member GetInt16 : int -> int16
override this.GetInt16 : int -> int16Public Overrides Function GetInt16 (i As Integer) As ShortPublic Function GetInt16 (i As Integer) As Short参数
- i
- Int32
从零开始的列序号。
返回
指定列的值。
实现
例外
指定的强制转换无效。
注解
不执行任何转换;因此,检索的数据必须已是 16 位有符号整数。
在调用此方法之前,调用 IsDBNull 检查 以获取 null 值。