Postback is Slow!!

J

Jess

Hello,

I have a web page with a datagrid. I'm using the built in paging
capabilities to allow paging. Each page shows 10 records.

When the page is first loaded, a thousand rows are retrieved from the db
into a dataset (on the server), and the first 10 are returned to the user to
fill the first page of the datagrid. This happens very quickly (1-2
seconds).

However, when the user clicks 'Next Page' to go to the next page of data in
the grid, the grid takes forever to show the second page (8-9 seconds). And
all I'm doing in code is changing the page index, retrieving the same 1000
rows into a dataset (on the server), and re-binding the grid to the dataset.

Running sql profiler against the database revealed that when the user clicks
'Next Page', the db doesn't get the call for 7-8 seconds.

Why does it take so long for the request to make its way from the client pc
to the server when 'Next Page' is clicked?

Thanks!!
 
N

Natty Gur

Hi,

1) I guess you are doing some action in your code that cause that
behavior. I suggest you will download code profiler (ants for example)
to find out where time slipped.

2) consider caching this dataSet in order to save further DB operations
and data retrieving every attempt to move to page.

3) By nature DataSet is slower from other methods to retrieve data. This
mainly due to the amount of metadata that dataset holds.



Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top