SharePoint: How to get Top 5 records by using CAML query from a list -
I've already created a webpage to show data from the list, but I really want to be just that top 5 Records to be shown in the list (using the CAML query).
Does anyone know how to do this? thanks a lot.
& lt; Query & gt; & Lt; OrderBy & gt; & Lt; FieldRef name = 'id' ascending = 'False' /> & Lt; / OrderBy & gt; & Lt; / Query & gt;
You can set the RowLimit property of your SPQuery object.
& lt; RowLimit & gt; The tag is in the schema definition of a view (the direct child of & lt; see & gt; ) and so it is & lt; Question & gt; tag.
Comments
Post a Comment