Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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;                                            
            }

        }
share|improve this question

1 Answer 1

Solved it. Silly me:

     "<Value Type='Boolean'>1</Value>" +          
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.