I realize this question isn't only about WebDataGrid, but it's related so, maybe it won't be considered offtopic.
I have a TSQL stored procedure that can run for a few minutes and return a few million records, I need to display that data in WebDataGrid. Obviously I don't want return all data at once and need to setup some kind of paging options - every time user selects another page - another portion of data is loaded from the DB. But I can't run the SP every time new page is requested - it would take too much time.
What would be the best way to persist data from the SP, so when user selects a new page - new data portion would be loaded by a simple SELECT... WHERE from that temp data storage?
Hi ygalanter,
I would suggest that you check the following sample of custom databinding, depending on the grid's paging - http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Data/Custom-DataBinding-Paging-Collection/Default.aspx?cn=data-grid&sid=56a2a94a-12e4-4108-a480-ff4bbf85852b.
Please let me know if this helps.
Thanks for the prompt reply, but that sample still retrieves full set of data before limiting it to the current page, not a real-life scenario.
In my case I cannot retrieve full resultset every time (it'sa long-running stored procedure), I need to temporarily store it somewhere, so I can cut it to custom ranges for custom databinding.
Any idea on how to implement this?
I would suggest you to have a look at the following articles about ASP.NET caching as these could be helpful in your case: http://msdn.microsoft.com/en-us/library/ms178597.aspx , http://msdn.microsoft.com/en-us/library/xsbfdd8c(v=vs.100).aspx .
If you need any further assistance on the matter please do not hesitate to ask.
Won't work for me, I don't think keeping several million of records of data in Session or Cache or anywhere in memory is a good idea. But thanks anyway.
I just found this article, which might be useful - http://www.asp.net/web-forms/tutorials/data-access/paging-and-sorting/efficiently-paging-through-large-amounts-of-data-cs. I hope this helps.
Thanks for the link, it will definitely be useful once I figure out how to temporary store results of long running stored procedure in a plain table for that method to work.
Hi,
Even i need to implement the same functionality and also export that data to excel. so if you could find the better solution then pleaseshare that. Thanks in advance.