Best place to hold dataset between postbacks?

Discussion in 'ASP .Net' started by Gandalf, Jul 18, 2003.

  1. Gandalf

    Gandalf Guest

    I have a page with a datagrid that is bound initially to a dataset. As the
    user changes items on the grid, I want to cache the changes until a final
    submit. Ideally I wish to update the dataset on each postback and at the
    end, submit the changes to the database. But where should I store the
    dataset? I can put it into the viewstate, but that gets very large, or I can
    put it in a session object. Which of these two is better? Are there any
    other alternatives?

    Thx
     
    Gandalf, Jul 18, 2003
    #1
    1. Advertising

  2. In most situations Session state would likely be the best place. Remember
    to deallocate when you're done with it so it will eat a minimal amount of
    memory. Even then it will take a significant amount of server memory for a
    while, which will put limitations on the scalability of your app. Using
    viewstate would offload some of that work to the client, but will increase
    your bandwidth needs. Another option would be to use a staging table in the
    database to save between each request. Of course this puts more load on
    your SQL Server.
    It's all about trade offs. No matter how you do it, the work has got to go
    somewhere, in some tier. Pick one. How about the least used one?

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "Gandalf" <> wrote in message
    news:...
    > I have a page with a datagrid that is bound initially to a dataset. As the
    > user changes items on the grid, I want to cache the changes until a final
    > submit. Ideally I wish to update the dataset on each postback and at the
    > end, submit the changes to the database. But where should I store the
    > dataset? I can put it into the viewstate, but that gets very large, or I

    can
    > put it in a session object. Which of these two is better? Are there any
    > other alternatives?
    >
    > Thx
    >
    >
     
    Steve C. Orr, MCSD, Jul 18, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PJ
    Replies:
    4
    Views:
    635
  2. Gary Vidal
    Replies:
    2
    Views:
    1,894
    Steven Cheng[MSFT]
    Feb 12, 2004
  3. thomson
    Replies:
    2
    Views:
    14,839
    Eliyahu Goldin
    Jan 19, 2005
  4. Kiran
    Replies:
    2
    Views:
    1,988
    Eliyahu Goldin
    Jun 8, 2005
  5. Replies:
    0
    Views:
    454
Loading...

Share This Page