Best place to hold dataset between postbacks?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Best place to hold dataset between postbacks?

    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 Guest

  2. Similar Questions and Discussions

    1. Postbacks and CommandEventArgs
      In the situation below I am calling "OnCommand(CommandEventArgs.Empty);" from IPostBackEventHandler.RaisePostBackEvent. but I get the compile...
    2. Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset
      Hi All, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data...
    3. PerlTK: using place to place the same widget twice
      Greetings, Is it possible to define a Perl/TK widget and then use the place method to place that widget more than once. I can't seem to figure...
    4. Problematic Postbacks
      this may be a stupid response, after updating the database, how about rebounding the label ? news.microsoft.com wrote:
    5. Grr Tables and postbacks
      Hi, If you create controls dynamically you should do it on every post back. Remove the (!IsPostBack) condition. Natty Gur, CTO Dao2Com Ltd....
  3. #2

    Default Re: Best place to hold dataset between postbacks?

    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
    [url]http://Steve.Orr.net[/url]


    "Gandalf" <gandalf@sauron.com> wrote in message
    news:uVbpjjLTDHA.212@TK2MSFTNGP10.phx.gbl...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139