Batch Inserting / Updating / Deleting

Last post 10-28-2008 5:36 PM by bubblesnout. 2 replies.

Sort Posts:

  • Batch Inserting / Updating / Deleting

    10-27-2008, 11:57 PM
    • Participant
      1,037 point Participant
    • bubblesnout
    • Member since 08-08-2007, 6:54 PM
    • Posts 238

    I am developing an application that is using the concept of an entire page being put into edit mode or read-only mode. When in read only mode, no changes should be saved to the database until a big 'Save' button is clicked at the top of the page. A single page I am putting together is based on a Office Network. You have the base details (which are done through a formview) such as Domain Name, Username format, etc. But you can also add any number of Servers underneath. the servers are  managed through a Gridview, so each item is inserted, then the gridview is rebound. This is a problem, as I don't actually want the Servers to be saved to the database (or removed in the case of a delete) until the large 'Save' button is hit at the top of the screen. What I really need to do is cache each change in memory somewhere, and then when the 'Save' button is hit, execute it all at once.

    Is there some easy way to do this that I am overlooking? I would imagine this is a rather common requirement.

  • Re: Batch Inserting / Updating / Deleting

    10-28-2008, 7:31 AM
    Answer
    • All-Star
      36,875 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 12:51 PM
    • Lincoln, England
    • Posts 5,951

     Its not simple to do do. You could build your own object datasource, save the details in the Session or Viewstate until the save is run and then push it all to a database by manually calling a save routine in your main save routine.

    For a glimpse of how this might be done you could check out Matt Berseths article which shows how to do an Excel style grid and it saves its details as I described above:

  • Re: Batch Inserting / Updating / Deleting

    10-28-2008, 5:36 PM
    • Participant
      1,037 point Participant
    • bubblesnout
    • Member since 08-08-2007, 6:54 PM
    • Posts 238

     Thanks very much for that. Pretty much what I expected, but that article looks quite nice, so I'll have a read through that and start getting it going.

Page 1 of 1 (3 items)