View Single Post
  #4 (permalink)  
Old July 26th, 2008, 11:48 PM
Old Pedant Old Pedant is offline
Friend of Wrox
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

Have you considered doing *both* the sorting and the paging all in SQL Server? Using T-SQL??

It's by far the most efficient way, bar none. Means a little more work on your part, but the end result could well be worthwhile.

No, I've never done this via ObjectDataSource, but I can't think it would be all that hard (you are allowed to make me eat my words, but give it a shot).

4Guys has a good set of articles on this, including how to get the best performance even when paging very large result sets. Take a peek:

And then Scott Mitchell talks about using this with an Object Data Source in a series of articles. Here are a few links, not sure which are most relevant:
(Articles are dated; 031506 means March 15, 2006, etc.)