View Single Post
  #5 (permalink)  
Old July 27th, 2008, 11:00 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

Hi there,

Take a look here:

then here:

At the bottom of the article you find some hints on Paging in the Comments section.

The problem is of course, that if you page in the database, you only get back the relevant records for the requested page. If you then try to sort, you only sort the current page.

So, either do sorting and paging in the database (fast and efficient, slight difficult to write, especially with dynamic sorting) or do everything in .NET (e.g. get all records, sort, then get the requested page from the results). Easier to write, but most likely will perform not as well as the database version as you need to retrieve all records first.



Imar Spaanjaars
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.