Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

.I am running below query against a sharepoint list.

How to check the results of below Camlquery? cPop is set with value 'AboutUs'.

Result is always zero records although list has valid matching records. Are there any tools that I can use to build & test queries?

                camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='RelateTo'/><Value Type='Choice'>" + cPop +
                        "</Value></Eq></Where><OrderBy Override='TRUE'><FieldRef Name='RelateTo'/></OrderBy><RowLimit>1</RowLimit></Query></View>";
share|improve this question
add comment

3 Answers 3

up vote 0 down vote accepted

You can try U2U Caml Builder. It isn't updated for SP 2010, but you can still connect via web services as seen here:

http://emmettlynch.wordpress.com/2011/03/28/sharepoint-2010-tool-bag-u2u-caml-query-builder/

Here's a link to the tool:

http://www.u2u.be/res/tools/camlquerybuilder.aspx

share|improve this answer
add comment

For 2010 there is the CAML designer on Karine Bosh's site:-

http://karinebosch.wordpress.com/my-articles/caml-designer/

share|improve this answer
    
I've never seen this before, but this is pretty cool. Frankly, I just write them by hand. –  RJ Cuthbertson Jul 12 '12 at 14:37
    
Yeah me too, they are fairly straight forward once you get used to them. –  PlanetWilson Jul 12 '12 at 14:54
    
I'm going to send the link to our intern though. He could definitely benefit from the use of it. –  RJ Cuthbertson Jul 12 '12 at 14:57
add comment

Well your query seems to be correct, I would try removing "order by" condition since there is only one result you are checking. I would assume your items are in root folder. Hope it works.

share|improve this answer
add comment

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.