IDataRecord.Item[] 屬性

定義

取得指定的資料行。

多載

Item[Int32]

取得位於指定索引位置的資料行。

Item[String]

取得具有指定名稱的資料行。

Item[Int32]

取得位於指定索引位置的資料行。

public:
 property System::Object ^ default[int] { System::Object ^ get(int i); };
public object this[int i] { get; }
member this.Item(int) : obj
Default Public ReadOnly Property Item(i As Integer) As Object

參數

i
Int32

要取得的資料行中以零為起始的索引。

屬性值

位於指定索引位置的資料行以做為 Object

例外狀況

傳遞的索引超出 0 到 FieldCount 的範圍。

適用於

Item[String]

取得具有指定名稱的資料行。

public:
 property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ name); };
public object this[string name] { get; }
member this.Item(string) : obj
Default Public ReadOnly Property Item(name As String) As Object

參數

name
String

要尋找的資料行名稱。

屬性值

具有指定名稱的資料行,以做為 Object

例外狀況

找不到具有指定名稱的資料行。

備註

會先執行區分大小寫的查閱。 如果失敗,則會進行第二個不區分大小寫的搜尋。

這個方法不區分假名寬度。

適用於