Get list item status using CAML query and updating status progrmatically
////// Method to get listItem status /// Author :Hima /// CopyRight :SyntaxHelp /// Created On :Feb 05 2010 /// /// /// public static void updateEmployeeStatus(string emailId, string status) { try { string eprList = ConfigurationSettings.AppSettings["EPRLIST"].ToString(); string strSiteRoot = ConfigurationSettings.AppSettings["EPRSite"].ToString(); SPSite eprSite = new SPSite(strSiteRoot); eprSite.AllowUnsafeUpdates = true; SPWeb eprSPweb = eprSite.OpenWeb(); SPQuery queryEPR = new SPQuery(); queryEPR.Query = ""; SPList eprSPList = eprSPweb.Lists[eprList]; SPListItemCollection eprSPItemCollection = eprSPList.GetItems(queryEPR); SPListItem eprSPItem; if (eprSPItemCollection.Count > 0) { eprSPItem = eprSPItemCollection[0]; eprSPItem["Status"] = status; eprSPItem.Update(); } eprSite.Dispose(); eprSPweb.Dispose(); } catch { } } " + emailId + "