Hi I have a SharePoint list to be queried for my Desktop App and I want to retrieve only the Active Members but when I queried I got only the users who aren't active. What is wrong with my CAML query?
camlQuery.ViewXml = "<<"View">><Query><Where><Eq><FieldRef Name='Active'/><Value Type='Boolean'> " + true + "</Value></Eq></Where></Query></View>"";
I tried the following as well
camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Active'/><Value Type='Boolean'> true</Value></Eq></Where></Query></View>";
and
camlQuery.ViewXml = "<Query><Where><Eq><FieldRef Name='Active'/><Value Type='Boolean'> true</Value></Eq></Where></Query>";
Please help as I'm new to CAML.
Save yourself some grief and use a tool to help build up CAML queries such as U2U's Caml Query Builder.
You need to use 1 and 0 (not true and false) in the query, so
<Query><Where>
<Eq><FieldRef Name="Active" /><Value Type="Boolean">1</Value></Eq>
</Where></Query>