Last post Feb 07, 2017 11:53 AM by dotnetnoob
Jan 21, 2017 05:01 PM|dotnetnoob|LINK
Hi All: I have a large sql table from which I am returning a subset of rows from a stored procedure, and binding to a listview with a datapager, in an Webforms 4.5 project.
I have read through Scott Mitchell's 2006 tutorial that involves building a custom datasource:
Is there an updated way to handle this in the current framework? Or do I need to just follow the example to build a custom datasource and bind the listview/datapager control to it?
Jan 24, 2017 05:49 AM|Eric Du|LINK
According to your description, as far as I know, you want to use custom paging with stored procedure to handle the large amount records! Please refer to the following links:
Custom Paging in ASP.Net GridView using SQL Server Stored Procedure:
If I misunderstand your meaning, please correct me!
Jan 24, 2017 11:26 AM|dotnetnoob|LINK
Thanks Eric: That is one way to handle it, but not by using the datapager and custom datasource, which was my question.
Feb 07, 2017 09:31 AM|Eric Du|LINK
According to your description, please refer to this tutorial(DataPager, ListView and Customer Datasource).
TIP/Trick: Use DataPager control with ListView and Custom Data Source:
Feb 07, 2017 11:53 AM|dotnetnoob|LINK
Thanks Eric: But this does not answer my question. It is just a basic description of the datapager. I'm trying to use the datapager with a sql stored procedure that is returning a subset of rows. The datapager itself doesn't provide methods to pass the record
count into it that is returned by the query, so either the datapager class needs to extended, or you need to build a custom datasource that returns all the required properties to the datapager.
In the end, I think it will be easier just to build a custom user-control that replicates the datapager's functionality, but I wanted to check if there are any new techniques in .NET 4.5 or even .NET 5 for managing the datapager.