Tuesday, 6 March 2012

Caml Query Client Object

I was wondering why the list query returns ALL of my list when the reason was that I have left out the <Query> tag! This is the working version...




SP.List oList = context.Web.Lists.GetByTitle("Projects");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "" + projectCode + "";
ListItemCollection collListItem = oList.GetItems(camlQuery);
context.Load(collListItem);
context.ExecuteQuery();

No comments:

Post a Comment