using System; using Microsoft.SharePoint.Client; using SP = Microsoft.SharePoint.Client; namespace Microsoft.SDK.SharePointServices.Samples { class RetrieveListItems { static void Main() { string siteUrl = "http://MyServer/sites/MySiteCollection"; ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements"); CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = "<View><Query><Where><Geq><FieldRef Name='ID'/>" + "<Value Type='Number'>10</Value></Geq></Where></Query><RowLimit>100</RowLimit></View>"; ListItemCollection collListItem = oList.GetItems(camlQuery); clientContext.Load(collListItem); clientContext.ExecuteQuery(); foreach (ListItem oListItem in collListItem) { Console.WriteLine("ID: {0} \nTitle: {1} \nBody: {2}", oListItem.Id, oListItem["Title"], oListItem["Body"]); } } } }
Sunday, 13 July 2014
Home
/
CSOM
/
Retrieve List Items
/
SharePoint 2013
/
Retrieve List Items in sharepoint list using client object model-CSOM
Retrieve List Items in sharepoint list using client object model-CSOM

About Gowtham
I'm a software developer who enjoys building solutions, exploring new tech, and helping others grow through clean and simple content. This blog shares real-world coding tips, Power Platform how-tos, AI experiments, and lessons learned from hands-on experience.
SharePoint 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment