Enumerate SharePoint List Items

This is an example of how to enumerate SharePoint list items.

Reference
Microsoft.Sharepoint (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll)

Code
SPListItemCollection listItems = web.Lists["Some List Name"].Items; foreach (SPListItem listItem in listItems) {   // This is the item we are looking for if (listItem["Some Field Name"].ToString == "Some value") {       break; } }