SqlDataReader.Item[] 屬性

定義

取得使用原生格式的資料行值。

多載

Item[String]

提供資料行名稱,取得使用原生格式的指定資料行值。

Item[Int32]

提供資料行序數,取得使用原生格式的指定資料行值。

Item[String]

提供資料行名稱,取得使用原生格式的指定資料行值。

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

參數

name
String

資料行名稱。

屬性值

原生格式的指定資料行值。

實作

例外狀況

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

備註

會先執行區分大小寫的查閱。 如果失敗,則會 (使用資料庫定序) 進行不區分大小寫比較的第二個不區分大小寫搜尋。 當比較受到特定文化特性大小寫規則的影響時,可能會發生非預期的結果。 例如,在土耳其文中,下列範例會產生錯誤的結果,因為土耳其文中的文件系統不會針對 「file」 中的字母 'i' 使用語言大小寫規則。

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

另請參閱

適用於

Item[Int32]

提供資料行序數,取得使用原生格式的指定資料行值。

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

參數

i
Int32

以零為基底的資料行序數。

屬性值

原生格式的指定資料行值。

實作

例外狀況

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

另請參閱

適用於