Click to See Complete Forum and Search --> : Delay in Displaying huge Data with Paging. Why?


ameenkpn
November 9th, 2005, 10:18 PM
Hi,

I'm displaying a large amount of data (nearly more than 20000 Records) in an asp.net page with paging. Each page displays 50 records. It takes nearly 40 to 50 seconds for loading the first page. When i click on the 2nd page or the next page, it takes same or more time.

I load the all the data within ispostback property in Page load event.

Even I have debugged my code. The debugger is also starts very late.

Why this happens?.. let me know the solution please.

Thanks

mmetzger
November 9th, 2005, 10:28 PM
Sounds like either you're binding the data too often and / or you have a very large viewstate enabled.

ameenkpn
November 9th, 2005, 11:00 PM
I'm binding the data only within IsPostBack only once when the Page loads.

But when i see the view source file, it shows me large viewstate data.. how to resolve it..

sivatvl
November 10th, 2005, 08:20 AM
Hi

Even though you use paging in datagrid the paging does not happen in the backend.

The complete data is fetched from the database and stored in the datasource that you are using to bind to the datagrid. Then the page pointer is moved accordingly to show the current page and then the 50 records for that page is shown.

So whether or not you use paging it will take the same time to fetch the data from database.

To avoid this you have to use custom paging by which you can fetch only the 50 records that are required for that page.

Regards
Siva