ASP.NET 2.0 - Custom Paging for GridView VS GridView Built-In Paging? Which one?

Wonder which one is faster. In the past, [correct me if I am wrong] developers chose to use custom paging instead of relying on datagrid paging.

Extra Information: You can use IDENTITY to do this custom paging.

How about now? I had seen articles people still recommeding custom paging using ROW_Function() which was part of SQL Server 2005 instead of relying on GridView paging.

Extra Information: You can do this:

SELECT ROW_Function() OVER (ORDER BY ProductID) AS Row, SomeProduct

FROM Product

WHERE ProductID = '1'

But most articles demonstrated on how to use GridView Paging. Maybe due to the simplicity of having a GridView pointing to a datasource and enabling sorting + paging without writing codes.

I can't visualize myself except I have multi millions of records in my database to test :P

Published Thursday, March 30, 2006 6:51 PM by chuawenching

Comments

# re: ASP.NET 2.0 - Custom Paging for GridView VS GridView Built-In Paging? Which one?

Thursday, March 30, 2006 9:24 PM by Firedancer
By default, the GridView built-in paging will acquire all the records, display the ones in the desired page and discard the rest. This is not good for performance when you have large resultsets.

The usage of ROW_NUMBER function in SQL Server 2005 is a better way. However, you cannot just use it like that. You can combine it with CTE to do paging.

# re: ASP.NET 2.0 - Custom Paging for GridView VS GridView Built-In Paging? Which one?

Thursday, March 30, 2006 11:45 PM by chuawenching
But based on my research, actually IDENTITY is faster than ROW_Function() ... correct me if I am wrong again :)

# re: ASP.NET 2.0 - Custom Paging for GridView VS GridView Built-In Paging? Which one?

Friday, March 31, 2006 9:33 PM by Firedancer
You can only use Identity column if you don't have deletes. Once there are deletes, you Identity column will not have continuous values.