共用方式為


SPListItem.Item property (Int32)

取得或設定值所含的上層清單的欄位集合中的指定索引處的欄位。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Overrides Default Property Item ( _
    index As Integer _
) As Object
    Get
    Set
'用途
Dim instance As SPListItem
Dim index As Integer
Dim value As Object

value = instance(index)

instance(index) = value
public override Object this[
    int index
] { get; set; }

參數

  • index
    Type: System.Int32

    32 位元整數父清單中指定之欄位的索引。

Property value

Type: System.Object
含有欄位值的物件。

Exceptions

Exception Condition
ArgumentOutOfRangeException

指定的索引超出集合的索引的有效範圍。

備註

如需SharePoint Foundation及如何與.NET 類型所使用的欄位類型的資訊,請參閱 < SPListItem類別。

重要

提升效能並最佳化 SQL Server 查詢數目該SharePoint Foundation必須執行,請使用SPList類別之GetItems方法來擷取取決於其欄位的值的項目。GetItems方法可讓您指定傳遞到SPQuerySPView類別的共同作業應用程式標記語言 (CAML) 查詢的搜尋準則。此外,如果清單包含整天大量的欄位,可能會危害清單效能。

請參閱

參照

SPListItem class

SPListItem members

Item overload

Microsoft.SharePoint namespace