Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. strategy for when to update DB from dataset [modified]

strategy for when to update DB from dataset [modified]

Scheduled Pinned Locked Moved Database
databasequestioncsharpannouncementlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ed 54
    wrote on last edited by
    #1

    Hi, What event should I use to trigger an update of a dataset to the originating DB, in order to take max advantage of dataset scalability without losing data? I'm building an ASP .NET website driven by an SSE database. Hopefully there will be several thousand users. When a user logs on, the codebehind queries the DB and retrieves up to several dozen records belonging to that user. The user can add, delete, and modify records on several webforms. I'm using a dataset and SqlDataAdapter to get the records at login and caching them in the Session object. Right now I'm calling SqlDataAdapter.Update(dataset) every time the user submits a webform with a new record. That works, but it doesn't seem very efficient. But I can't figure out how else to do it without potentially losing records. What if the user enters a record, and then closes the browser window? What if he times out or goes to another website before my Update method runs? How do I take better advantage of datasets and data adapters? Is there a way to detect the end of a Session and set up an event handler to run an update then? Or maybe cache to the Application and run an update on time intervals? I apologize if this question is elementary. I'm early in the learning process for C# / ASP .NET / ADO. TIA -- modified at 0:15 Wednesday 5th July, 2006

    F 1 Reply Last reply
    0
    • E Ed 54

      Hi, What event should I use to trigger an update of a dataset to the originating DB, in order to take max advantage of dataset scalability without losing data? I'm building an ASP .NET website driven by an SSE database. Hopefully there will be several thousand users. When a user logs on, the codebehind queries the DB and retrieves up to several dozen records belonging to that user. The user can add, delete, and modify records on several webforms. I'm using a dataset and SqlDataAdapter to get the records at login and caching them in the Session object. Right now I'm calling SqlDataAdapter.Update(dataset) every time the user submits a webform with a new record. That works, but it doesn't seem very efficient. But I can't figure out how else to do it without potentially losing records. What if the user enters a record, and then closes the browser window? What if he times out or goes to another website before my Update method runs? How do I take better advantage of datasets and data adapters? Is there a way to detect the end of a Session and set up an event handler to run an update then? Or maybe cache to the Application and run an update on time intervals? I apologize if this question is elementary. I'm early in the learning process for C# / ASP .NET / ADO. TIA -- modified at 0:15 Wednesday 5th July, 2006

      F Offline
      F Offline
      Frank Kerrigan
      wrote on last edited by
      #2

      Run the code SessionEnd event as well if its a ASP.NET web page. Look where you want to go not where you don't want to crash. Bikers Bible

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups