Re: DataGrid paging - a question of efficiency

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Scott M. (s-mar_at_nospam.nospam)
Date: 02/13/05


Date: Sun, 13 Feb 2005 15:44:34 -0500

I did read what you wrote. My response was basically that you have 3
choices:

1. Bring down a copy of all the data on the first page load and store it
for subsequent page loads. The pro's of this are that you don't go to the
data source on each page call. The con is that you are bringing down all
the records but only displaying some of them.

2. Use custom paging and bring down just the records you intend to show.
The upside is that you use considerably less bandwidth. The downside is
that you have to go to the datasource on each page call.

3. Hybrid of the first 2 choices...Get a copy of all the data on the fist
page load and store it. Subsequent page calls can use custom paging against
this copy of the data to get just the records you are interested in.
Advantages here are that you just make one trip to the original data store
(freeing it up to handle other application requests), you can use page
output caching to reduce server processing as well. Downside is that you
are making a copy of the data and holding it in memory somewhere.

"Shawn" <bossman100@hotmail.com> wrote in message
news:OkNkY7eEFHA.3908@TK2MSFTNGP12.phx.gbl...
>> Why are you re-creating and re-populating the temp table on each page
>> request?
> The temp table is created by my stored procedure. When the stored
> procedure
> has finished all temp tables cerated by that SP are automatically dropped
> by
> sybase.
>
>> Why not store this data in ViewState or the Cache or some other
>> medium?
> Thats exactly what I'm considering. Return all rows from the SP (not just
> 10 and 10), fill the datagrid with all of them, but only show 10 rows at
> the
> time. That way all rows would all be stored in ViewState.
>
>> The only time you should be going back to the database is on the
>> first page load unless you want to use custom paging and you are going to
>> the db on each page call, but only bringing down 1 page worth of data.
> Didn't you read what I wrote? I am using custom paging. I am returning
> to
> the db (SP) on each page call and bringing back 1 page (10 rows) of data.
>
> Shawn
>
> "Scott M." <s-mar@nospam.nospam> wrote in message
> news:ODQdgeeEFHA.2508@TK2MSFTNGP09.phx.gbl...
>> Why are you re-creating and re-populating the temp table on each page
>> request? Why not store this data in ViewState or the Cache or some other
>> medium? The only time you should be going back to the database is on the
>> first page load unless you want to use custom paging and you are going to
>> the db on each page call, but only bringing down 1 page worth of data.
>>
>>
>>
>> "Shawn" <bossman100@hotmail.com> wrote in message
>> news:ew3ZmPeEFHA.1292@TK2MSFTNGP10.phx.gbl...
>> > Hi.
>> >
>> > I already have a datagrid where I'm using paging. I have a stored
>> > procedure
>> > that fills a temp table with 200-500 rows and then sends back 10
>> > records
>> > at
>> > the time. When I go to page 2 the SP fills the temp table again and
>> > returns
>> > rows 10-19. The temp table is dropped after each call to the SP, so it
>> > has
>> > to be created and filled every time the user changes page in the
> datagrid.
>> > My question is this: Would it be more efficient to return all rows to
> the
>> > datagrid and set the visibility on each datagriditem instead? After
>> > the
>> > datagrid is filled up I could hide all but the 10 first datagrid items,
>> > and
>> > when the user changes to page 2 I could set only datagrid items 10-19
>> > visible etc. I have read quite a lot about custom paging, but I have
>> > never
>> > read anything about this approach therefore I'm interested in what you
>> > experts have to say. Is it a good idea?
>> >
>> >
>> >
>> > Thanks,
>> >
>> > Shawn
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: How to bring multiple properties between postbacks?
    ... serialising? ... > David, you can save the whole object in viewstate, session, etc. if that's ... >> to save the whole class and then load it up again after postback. ... >> an array for example and store in the ViewState... ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: How to bring multiple properties between postbacks?
    ... David, you can save the whole object in viewstate, session, etc. if that's ... > to save the whole class and then load it up again after postback. ... > an array for example and store in the ViewState... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: problem in the dataset
    ... Two possible places to store the dataset are in the viewstate or in the ... You could also store the information in the session, ... The basic idea is that you load the data on page load and immediately ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: A "killer" macro
    ... (defconstant load 8) ... (defconstant store 9) ... giving the opcode behind that mnemonic on that architecture. ... sophisticated way to work around the limitations of the "case" macro. ...
    (comp.lang.lisp)
  • Re: How Many Processor Cores Are Enough?
    ... A load by Pi is considered performed at a point in time when the ... A store by Pi is considered performed with respect to Pk (i and k ... It's defined in the Itanium manuals and is equivalent to Sparc TSO ...
    (comp.arch)