XmlElement camlQuery = Build(); // how to implement this?
I have a SharePoint list
called Authors which has an genericId field.
How to write a CAML query for something like below:
Select Name from Authors where genericId = 1
Then the camlQuery will be passed to the ListItems sharepoint web service:
http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx
What I have tried is to create an xml element as below:
XmlDocument xmlDoc = new XmlDocument();
XmlElement camlQuery = xmlDoc.CreateElement("Query");
camlQuery.InnerXml = "<Where><Lt><FieldRef Name='genericId'/><Value Type='Integer'>9</Value></Lt></Where>";
Then this is passed to the GetListItems() service (not sure what's the meaning of Lt or Gt, etc?).
But it throws an exception:
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
Many thanks,