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?
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!
Best Regards,
Eric Du
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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.
Member
94 Points
818 Posts
paging listview from custom datasource
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:
https://www.asp.net/web-forms/overview/data-access/paging-and-sorting/efficiently-paging-through-large-amounts-of-data-cs
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?
Contributor
6730 Points
2715 Posts
Re: paging listview from custom datasource
Jan 24, 2017 05:49 AM|Eric Du|LINK
Hi dotnetnoob,
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:
http://www.aspsnippets.com/Articles/Custom-Paging-in-ASPNet-GridView-using-SQL-Server-Stored-Procedure.aspx
If I misunderstand your meaning, please correct me!
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
94 Points
818 Posts
Re: paging listview from custom datasource
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.
Contributor
6730 Points
2715 Posts
Re: paging listview from custom datasource
Feb 07, 2017 09:31 AM|Eric Du|LINK
Hi dotnetnoob,
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:
http://blog.mrroa.com/2010/07/20/tiptrick-use-datapager-control-with-listview-and-custom-data-source/
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
94 Points
818 Posts
Re: paging listview from custom datasource
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.