Everything SharePoint and XAML

My continuous learning of SharePoint, XAML, Silverlight, Windows Phone 7, Windows 8, Office, VSTO, C#…

CAML Query Builder – Returns all Items

Posted by Steve Pietrek on February 8, 2008

I like CAML Query Builder. I use it often. Highly recommended. By specifying a URL and selecting a list, you can quickly build out your CAML query. There are a few things you need to be aware of however:

1. By default, the CAML query contains <Query>. If you include <Query>, the query will return all items in the list. To apply the query, remove <Query> and </Query>

<Query><OrderBy><FieldRef Name='Sequence'/></OrderBy></Query>

2. The copy to clipboard includes double quotes which results in the error: CS1002: ; expected:

<OrderBy><FieldRef Name="Sequence"/></OrderBy>

To fix, just replace the double quotes with single quotes

<Query><OrderBy><FieldRef Name='Sequence'/></OrderBy></Query>

I’m sure these items are documented – I just missed them.

Update 1 (2/8/2008): Looks like Àlex Peláez ran into the same issue.

Advertisements

Sorry, the comment form is closed at this time.

 
%d bloggers like this: