Skip to main content
Go Search

Ayman El-Hattab's Blog [MVP]

Home
Ayman El-Hattab's Blog
Marwan Tarek's Blog
Mohamed Yehia's Blog
  

SharePoint 4 Arabs - Online SharePoint Training, Video Tutorials and Webcasts in Arabic > Ayman El-Hattab's Blog [MVP] > Posts > SPQuery to External List ignores the RowLimit attribute
SPQuery to External List ignores the RowLimit attribute

Using CAML Queries is the only supported way to query external lists. It comes in very handy If you want to retrieve external data within a sandboxed application, without using a full-trust proxy. However using CAML Queries with external lists comes with some gotchas. Consider the following snippet :

SPQuery query = new SPQuery();                               
query.Query = "<Method Name='ReadList' />" +
"<OrderBy><FieldRef Name=\"CustomerID\"/></OrderBy>" +
"<RowLimit Paged=\"TRUE\">10</RowLimit>" +
"<Aggregations Value=\"Off\"/>";
                                 

SPListItemCollection items = lstCustomers.GetItems(query);

Unfortunately, this query just ignores the RowLimit and returns all the data from the external data source and not only the first 10 items as specified in the query. This is a known issue!

For more information :

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/7a86ba74-ea19-42f3-bde9-690542c84552

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Attachments