DataReader.GetItem 方法

定义

重载

GetItem(Int32)

检索当前数据块中指定索引处的项的值。

GetItem(String)

检索当前数据块中具有指定名称的数据项的值。

GetItem(Int32)

检索当前数据块中指定索引处的项的值。

public:
 abstract System::Object ^ GetItem(int index);
public abstract object GetItem (int index);
abstract member GetItem : int -> obj
Public MustOverride Function GetItem (index As Integer) As Object

参数

index
Int32

在要检索整数值的数据项的当前块中建立索引。

返回

Object

从当前数据块中的指定索引处返回一个整数值。

例外

index 参数无效。

适用于

GetItem(String)

检索当前数据块中具有指定名称的数据项的值。

public:
 abstract System::Object ^ GetItem(System::String ^ name);
public abstract object GetItem (string name);
abstract member GetItem : string -> obj
Public MustOverride Function GetItem (name As String) As Object

参数

name
String

当前块中要检索的数据项的名称。

返回

Object

返回具有指定名称的项的字符串值。

例外

name 参数无效。

适用于