다음을 통해 공유


SPFieldIndexCollection.Add Method (SPField)

Adds an index definition to the collection. This method includes one specified field in the index definition.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Function Add ( _
    field As SPField _
) As Guid
'Usage
Dim instance As SPFieldIndexCollection
Dim field As SPField
Dim returnValue As Guid

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

Parameters

Return Value

Type: System.Guid
Returns a Guid value that contains the index definition.

Remarks

If the field input parameter is null , this method throws an ArgumentNullException exception. If this exception exceeds capacity, this method throws an exception of ArgumentOutOfRangeException. If the Guid value is Guid.Empty, this method throws an ArgumentException exception.

See Also

Reference

SPFieldIndexCollection Class

SPFieldIndexCollection Members

Add Overload

Microsoft.SharePoint Namespace