SharePoint and CAML queries

Okay now for the more technical stuff: in case you have been using a great tool called U2U Caml Query Builder (from U2U) and you are wondering why SharePoint list queries do return all items in the lists, be sure to check out that in the code you do not insert "<QUERY>" tags in your text, something like this:
"<Query><Where><Eq><FieldRef Name=’Author’ /><Value Type=’Text’>’Me'</Value></Eq></Where></Query>"
This will return all the list items, but if you remove "<Query>" tags, then caml query goes well:
"<Where><Eq><FieldRef Name=’Author’

Now I need to admit that I haven’t done enough research on how efficient caml queries are compared to "normal" item by item looping using foreach or such things, but I have a feeling that this might be more rocking option, at least you definedly control what you get as a result.

About Sakarih

I am SharePoint developer/architect from Finland and my blogposts are all about SharePoint 2007/2010/2013 stuff. There might be also something else posted.
This entry was posted in SharePoint. Bookmark the permalink.

One Response to SharePoint and CAML queries

  1. Finanzen says:

    That was very forthcoming piece

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s