共用方式為


SPFieldIndexCollection.Add method (SPField)

加入集合中的索引定義。這個方法會在索引定義中包含一個指定的欄位。

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

Syntax

'宣告
Public Function Add ( _
    field As SPField _
) As Guid
'用途
Dim instance As SPFieldIndexCollection
Dim field As SPField
Dim returnValue As Guid

returnValue = instance.Add(field)
public Guid Add(
    SPField field
)

參數

傳回值

Type: System.Guid
傳回含有索引定義的Guid值。

備註

如果欄位的輸入的參數是 null ,這個方法會擲回例外狀況ArgumentNullException 。如果這個例外狀況超出容量,這個方法會擲回例外狀況的ArgumentOutOfRangeException。如果Guid值是Guid.Empty,這個方法會擲回例外狀況ArgumentException 。

請參閱

參照

SPFieldIndexCollection class

SPFieldIndexCollection members

Add overload

Microsoft.SharePoint namespace