Monday, March 30, 2009

CAML query - getting more than 10 results

Another thing you should keep in mind when you use CAML QUERING is the fact that by default the query is going to return just the first 10 result so you should specify the maximum number of row that you want the query return to you, you achieve this with the tag : <Range><StartAt>1</StartAt><Count>10000</Count></Range>

 

Using the example above to get 10,000 results your query could look like this:

 

<Query>

   <Where>

      [.....]

   </Where>

  <Range>

    <StartAt>1</StartAt>

    <Count>10000</Count>

  </Range>

</Query>

 

Useful to use this parameters to page results.

 

Another CAML (tip) from Miguel ;-)

 

1 comment: