I have an requirement of get the items from the list depends on the ItemID.I have list which contains 5000 items in which I retrieve only 1000 items for that I will dynamically build the CAML query using JohnHoliday CAML.NET and the query have 1000 conditions at that time I got Value does not fall within the Expected Range error. The query works fine upto 150 items but it throws error when the ItemID increases.Could you provide a suitable workaround for this issue ?

1 Answer 1


If you are using SPQuery then the RowLimit property should do the trick, but you should also check the item limit on the default view.

Source: CAML return only 10 results

  • Thats not how I read the OP question - I think hes basically doing the equiv of a SQL IN - e.g. WHERE ID IN (1,2,5,19,37) - but its failing when using more than 150 conditions.
    – Ryan
    Commented Mar 29, 2011 at 12:31
  • Ooooh, he has more than 150 conditions. The question has changed now to something different, there no more source code :))))). In such case I guess he is hitting a true limit... Commented Mar 29, 2011 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.