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. Web Development
  3. ASP.NET
  4. prevent Multiple users updating same record same time and same table

prevent Multiple users updating same record same time and same table

Scheduled Pinned Locked Moved ASP.NET
4 Posts 4 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.
  • V Offline
    V Offline
    vishnukamath
    wrote on last edited by
    #1

    Hi, I need to prevent multiple users updating same record same time and same table , i tried with Sq l-transactions , every user data updating properly but last user data will be the current data , here i need to show alert message for second user onwards. Please suggest me better way to do this. Regards, Vishnu.

    P T D 3 Replies Last reply
    0
    • V vishnukamath

      Hi, I need to prevent multiple users updating same record same time and same table , i tried with Sq l-transactions , every user data updating properly but last user data will be the current data , here i need to show alert message for second user onwards. Please suggest me better way to do this. Regards, Vishnu.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      The accepted way to do this is to hold some form of version information on the table (be it an update tickcount, or incrementing number). Retrieve this with your record, and pass it back in when you attempt to update the record. If the version doesn't match on the update, it means that somebody else has updated the record while you were editing it. At this point, you can inform the user that the record has been updated by somebody else.

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      1 Reply Last reply
      0
      • V vishnukamath

        Hi, I need to prevent multiple users updating same record same time and same table , i tried with Sq l-transactions , every user data updating properly but last user data will be the current data , here i need to show alert message for second user onwards. Please suggest me better way to do this. Regards, Vishnu.

        T Offline
        T Offline
        thatraja
        wrote on last edited by
        #3

        This will help you. 6 ways of doing locking in .NET (Pessimistic and optimistic)[^]

        thatraja


        **My Tip/Tricks
        My Dad had a Heart Attack on this day so don't...
        **

        1 Reply Last reply
        0
        • V vishnukamath

          Hi, I need to prevent multiple users updating same record same time and same table , i tried with Sq l-transactions , every user data updating properly but last user data will be the current data , here i need to show alert message for second user onwards. Please suggest me better way to do this. Regards, Vishnu.

          D Offline
          D Offline
          Dalek Dave
          wrote on last edited by
          #4

          Try locking access, just flag up if it is currently being accessed and stop further access to it.

          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

          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