Paging DataList from Database

Paging DataList from Database

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


Amir posted on Monday, October 08, 2007

Hi

Why when the paging is implemented in database (which my database stored procedure returns precise number of records based on the page size) and the web control is being paged is a DataList or Repeater that doesn't have built-in paging mechanism, I have to use any DataSource object like CslaDataSource?
As far as I understand the DataSource object becomes a mediator that get the Business Object and bind it to the control. The paging controls (like the label that shows the current page) have to be updated manually anyway (in the Select event of DataSource Object).

Why can't I just bind the Business Object directly to the DataList and update the Pager's display controls manually? Am I missing something or it's another separation between the UI and the Business Objects Layer?

Amir replied on Tuesday, October 09, 2007

Amir:

Let me ask it this way:

What's the advantage of using CslaDataSource in this case (Paging is done in Database)?

Copyright (c) Marimer LLC