SPQuery returns all the items

There is a silly mistakes which we generally do in CAML query.

I have written a simple query to fetch some items based on title:

<where><Eq><FieldRef Name=’Title’ /><Value Type=’Text’>Prasanta</Value></Eq></Where>

it returns all the items from the List.

 

Later I found <where> tag  is in lowercase in my query for which it considers it as wrong query and return all the items. Hence corrected

Make sure all the tags in query should be proper case

<Where><Eq><FieldRef Name=’Title’ /><Value Type=’Text’>Prasanta</Value></Eq></Where>

Thanks,

 

About Prasanta Barik

Hello
This entry was posted in SharePoint issues and tagged , . Bookmark the permalink.

Leave a comment