Mritunjay Chourasia
Tuesday, September 8, 2009
Getting Sharepoint list item using lamda expression
SPSite objSPSite = new SPSite(@"http://server:portno/sites/myExample");
SPWeb objSPWeb = objSPSite.OpenWeb("mk");
SPList objSPList = objSPWeb.Lists["EmployeeList"];
IEnumerable
oSPListItemEnum = objSPList.Items.OfType
();
foreach (SPListItem objSPListItem in oSPListItemEnum.Where
(x => x["ows_Status"].ToString() == "Closed" ))
{
Console.WriteLine(objSPListItem["Name"].ToString());
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment