SPListItem.Item property (String)
Gets or sets a field value in the item based on the field’s title, internal name, or static name.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Parameters
- fieldName
- Type: System.String
A string that contains the title, internal name, or static name of the field.
| Exception | Condition |
|---|---|
| ArgumentException | The field does not exist. |
The Item property is an indexer for the SPListItem class.
The runtime will search first through the internal names of the list item’s fields for the specified string before searching the display names.
For information about the field types that are used in SharePoint Foundation and how they relate to .NET Framework types, see the SPListItem class.
Important
|
|---|
To improve performance and optimize the number of SQL Server queries that SharePoint Foundation must execute, use the GetItems method of the SPList class to retrieve items based on the value of their fields. The GetItems method allows you to specify search criteria by passing a Collaborative Application Markup Language (CAML) query through the SPQuery or SPView class. In addition, list performance may be compromised if a list contains an unnecessarily large number of fields. |
Important