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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. synchronization of dataset with sql server database

synchronization of dataset with sql server database

Scheduled Pinned Locked Moved Visual Basic
databasesql-serversysadminhelptutorial
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.
  • P Offline
    P Offline
    praveenkumar palla
    wrote on last edited by
    #1

    Hi, I want to decrease the no of roundtrips to the database for that i have implemented that on form_load i am retrieving the datarows required from the database and storing those in the dataset. And i am doing all the modification(updates,delete and inserts) in dataset and finally using dataadapter and commandbuilder objects i am updating all the modifications to the database at a one shot. This is working fine. But I need help to synchronize the dataset to the database i.e. On form_load i filled the dataset and after that another user updated the database but my dataset doesn't have these updates, so when i update database using mydataset and dataadapter and command builder the updates done by another user earlier have been overwritten. I heared that Merge method of dataset is helpfull in this scenarios, but for me it is not working so plz help me on this by giving small example. Thanks in advance

    D 1 Reply Last reply
    0
    • P praveenkumar palla

      Hi, I want to decrease the no of roundtrips to the database for that i have implemented that on form_load i am retrieving the datarows required from the database and storing those in the dataset. And i am doing all the modification(updates,delete and inserts) in dataset and finally using dataadapter and commandbuilder objects i am updating all the modifications to the database at a one shot. This is working fine. But I need help to synchronize the dataset to the database i.e. On form_load i filled the dataset and after that another user updated the database but my dataset doesn't have these updates, so when i update database using mydataset and dataadapter and command builder the updates done by another user earlier have been overwritten. I heared that Merge method of dataset is helpfull in this scenarios, but for me it is not working so plz help me on this by giving small example. Thanks in advance

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      praveenkumar palla wrote:

      and after that another user updated the database but my dataset doesn't have these updates

      This requirement just dictated to you that you can't just load the data in FormLoad and hold onto it. Now you have no choice but to keep the round trips and hold onto data only as long as you need to update it. Search Googling around for "ADO.NET Concurrency" and you'll find that this is not an easy problem to solve. Oh...and "Merge" isn't going to help you here.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      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