Grid Paging at the Database Level

Grid Paging at the Database Level

Old forum URL: forums.lhotka.net/forums/t/4117.aspx


vdhant posted on Thursday, January 03, 2008

Hi guys
Just wondering I anyone has come up with a nifty way of going paging using CSLA at the database level. I would prefer not to have to reinvent the wheel so I was wondering if anyone has addressed this problem before.

Any solution I guess would involve some common code that is wrapped onto the base classes or included in each list implementation and some backing SQL code that makes it possible.

The paging system should allow me to show records 20 - 39 and there are 200 records in total and only bring back records 20 - 39 from the database. Also allowances would need to be made for the fact that the grid needs to support sorting on top of this. Lastly it would be great if there was the additional support when looking at a details page to click a next and previous button which allowed the user to go either way in relation to the page placement that they are at and the sort that has been applied.

Thanks
Anthony 

RockfordLhotka replied on Friday, January 04, 2008

Have you looked at the sorting content in the CSLA .NET Version 2.1 Handbook? In version 2.1 I added a bunch of support for sorting concepts that allow you to do the sorting in the grid, factory, DP_Fetch() or stored procedure as you choose.

For large amounts of data, doing the sort in DP_F or a sproc is best. You do need a scheme by which you can page the data itself, but if you google you'll find some good articles on how to do database-level paging in SQL 2005 or higher.

vdhant replied on Friday, January 04, 2008

Thanks a lot for that.
I am going through the 2005 book at the moment which is probably why I didn't find it. I will look into the handbooks.

Thanks
Anthony

Copyright (c) Marimer LLC