I am trying to query Sharepoint 2010 via the Web Service using CalmQuery.
I created the calmQuery through a calmquery buidler, so im pretty sure the query is correct, however the GetListItems() ignore this query and just gets every item in the list:
here is my code:
/* Query */
XmlDocument calmDocument = new XmlDocument();
XmlNode camlNode = calmDocument.CreateElement("Query");
camlNode.InnerText = "<Where>" +
"<Eq>" +
"<FieldRef Name='Office_x0020_Staff' />" +
"<Value Type='Boolean'>Yes</Value>" +
"</Eq>" +
"</Where>";
XmlNode Test = GetService().GetListItems("Staff", null, camlNode, null, null, null, null);
for (int i = 0; i < Test.ChildNodes[1].ChildNodes.Count; i++)
{
if (Test.ChildNodes[1].ChildNodes[i].Attributes != null)
{
MessageBox.Show(Test.ChildNodes[1].ChildNodes[i].Attributes["ows_Title"].InnerText;
}
}