SqlDataRecord.GetOrdinal(String) 方法

定义

返回此列名指定的列序号。Returns the column ordinal specified by the column name.

public:
 virtual int GetOrdinal(System::String ^ name);
public virtual int GetOrdinal (string name);
abstract member GetOrdinal : string -> int
override this.GetOrdinal : string -> int
Public Overridable Function GetOrdinal (name As String) As Integer

参数

name
String

要查找的列的名称。The name of the column to look up.

返回

从零开始的整数列序号。The zero-based ordinal of the column as an integer.

实现

异常

namenullname is null.

无法找到此列名。The column name could not be found.

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

适用于