SqlDataRecord.GetSqlInt16(Int32) 方法

定义

获取序号所指定的列的值,其形式为 SqlInt16Gets the value for the column specified by the ordinal as a SqlInt16.

public:
 virtual System::Data::SqlTypes::SqlInt16 GetSqlInt16(int ordinal);
public virtual System.Data.SqlTypes.SqlInt16 GetSqlInt16 (int ordinal);
abstract member GetSqlInt16 : int -> System.Data.SqlTypes.SqlInt16
override this.GetSqlInt16 : int -> System.Data.SqlTypes.SqlInt16
Public Overridable Function GetSqlInt16 (ordinal As Integer) As SqlInt16

参数

ordinal
Int32

从零开始的列序号。The zero-based ordinal of the column.

返回

SqlInt16 形式的列值。The column value as a SqlInt16.

异常

ordinal 小于 0 或大于列数(即 FieldCount)。The ordinal is less than 0 or greater than the number of columns (that is, FieldCount).

类型不匹配。There is a type mismatch.

适用于