Paging and cache

T

tshad

When a GridView gets information back from the server and it is doing paging
(or anytime I suppose).

Where is it putting the data while it renders the data.

If I do a DataBind or use an SQLDataSource and the data comes back (say
10,000 rows) and you are having the GridView handle the paging. Where does
it put the data in the interim?

Does it cache it on the Client side somewhere?

Thanks,

Tom
 
M

Mr. Arnold

tshad said:
When a GridView gets information back from the server and it is doing paging
(or anytime I suppose).

Where is it putting the data while it renders the data.

If I do a DataBind or use an SQLDataSource and the data comes back (say
10,000 rows) and you are having the GridView handle the paging. Where does
it put the data in the interim?

Does it cache it on the Client side somewhere?

It goes back to the database each time you page I suspect when using a
datasource.
 
T

tshad

Mr. Arnold said:
It goes back to the database each time you page I suspect when using a
datasource.

Right.

But when you do a DataBind - The database would send you back all the data
you request at once (unless you are using a Reader) and it would have to be
stored in some structure while the object is working with it (extracting a
page for instance) or before the rendering of the page.

I am just curious as to where asp puts it - in some dataset somewhere?

For example, I could do an stored procedure call from a GridView.DataBind()
and 10,000 rows could come back but I only want page 5. The GridView would
have to store the 10,000 rows somewhere and determine which rows to put on
the page. Could be in a DataSet somewhere and when the page is rendered it
would go through the dataset to get the data it needs.

Where would the DataSet be? Since the DataBind() would be done on the
server, where would the Server put it before it rendered the page.

Thanks,

Tom
 
M

Mr. Arnold

tshad said:
Right.

But when you do a DataBind - The database would send you back all the data
you request at once (unless you are using a Reader) and it would have to be
stored in some structure while the object is working with it (extracting a
page for instance) or before the rendering of the page.

I am just curious as to where asp puts it - in some dataset somewhere?

For example, I could do an stored procedure call from a GridView.DataBind()
and 10,000 rows could come back but I only want page 5. The GridView would
have to store the 10,000 rows somewhere and determine which rows to put on
the page. Could be in a DataSet somewhere and when the page is rendered it
would go through the dataset to get the data it needs.

Where would the DataSet be? Since the DataBind() would be done on the
server, where would the Server put it before it rendered the page.

It goes back each time one pages and reads those 10,000 records every
time. As far as what page to page too and how many lines per page, that
has already been predetermined.

That dataset is only good for the life of the page, and if one wanted to
save the dataset and bind to the dataset and not go back to the
database, then on puts the dataset in a session variable and save it,
binding the dataset held in session to the control.
 
T

tshad

Mr. Arnold said:
It goes back each time one pages and reads those 10,000 records every
time. As far as what page to page too and how many lines per page, that
has already been predetermined.

That dataset is only good for the life of the page, and if one wanted to
save the dataset and bind to the dataset and not go back to the database,
then on puts the dataset in a session variable and save it, binding the
dataset held in session to the control.

I understand that.

I think you misunderstand what I am asking. This question came up at work
today.

I am trying to figure out where the data is stored while it is rendering the
page. The data has to be somewhere after the result set is returned until
the data is rendered to the screen.

Where is it?

Thanks,

Tom
 
M

Mr. Arnold

tshad said:
I understand that.

I think you misunderstand what I am asking. This question came up at work
today.

I am trying to figure out where the data is stored while it is rendering the
page. The data has to be somewhere after the result set is returned until
the data is rendered to the screen.

The data for a given page is saved in view state, if view state for the
control has been enabled. The data is in the dataset for the life of the
page.
 
A

Andy O'Neill

I am trying to figure out where the data is stored while it is rendering
the page. The data has to be somewhere after the result set is returned
until the data is rendered to the screen.

Where is it?

Thanks,

Tom
It's in whatever is your datasource.

It is most definitely NOT sent to the client.
With default paging, the gridview takes whichever subset it wants out of the
datasource.
So you could read data into a collection and cache it before handing it to
your datasource, which in turn is used by the gridview.
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top