SPFieldCollection.GetField method

Returns the field with the specified internal, display, or static name from the collection.

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

Syntax

'Declaration
Public Function GetField ( _
    strName As String _
) As SPField
'Usage
Dim instance As SPFieldCollection
Dim strName As String
Dim returnValue As SPField

returnValue = instance.GetField(strName)
public SPField GetField(
    string strName
)

Parameters

  • strName
    Type: System.String

    A string that specifies either the internal, display, or static name of the field.

Return value

Type: Microsoft.SharePoint.SPField
An SPField object that represents the field.

Exceptions

Exception Condition
ArgumentException

The field is not found.

Remarks

Microsoft SharePoint Foundation searches first by internal name; then, if necessary, by display name; finally, if necessary, by static name.

See also

Reference

SPFieldCollection class

SPFieldCollection members

Microsoft.SharePoint namespace