Tip #67: SPQuery in SP2010 Server returns folders first

Rate this item
(0 votes)

 SharePoint Server 2010 adds a default OrderBy clause to SPQuery call that orders the result set by content type, which ensures that folders are returned before list items.

For SharePoint Foundation 2010 you need to include of the three OrderBy clauses—ContentIterator.ItemEnumerationOrderByID, ContentIterator.ItemEnumerationOrderByPath, or ContentIterator.ItemEnumerationOrderByNVPField when using SPQuery

Source: http://msdn.microsoft.com/en-us/library/ee558807(office.14).aspx

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.