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. How to menage concurrency with timestamp (C#)

How to menage concurrency with timestamp (C#)

Scheduled Pinned Locked Moved Database
csharptutorialquestionannouncement
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.
  • V Offline
    V Offline
    ventomito
    wrote on last edited by
    #1

    hi everybody, i want to know how to menage the optimistic cuncurrency using timestamp. i've already added a column for every table (timestamp type). how i can modify the Update command to use it? (im using C# 2005) Thank you in advance Enrico VentoEngine corp. Program your life ^^

    E 1 Reply Last reply
    0
    • V ventomito

      hi everybody, i want to know how to menage the optimistic cuncurrency using timestamp. i've already added a column for every table (timestamp type). how i can modify the Update command to use it? (im using C# 2005) Thank you in advance Enrico VentoEngine corp. Program your life ^^

      E Offline
      E Offline
      Edbert P
      wrote on last edited by
      #2

      During your SELECT statement you can get the timestamp and keep it for updating purpose later. I usually save the timestamp as long variable. On your update statement, pass the timestamp as a parameter along with the rest that you need to make sure you update the correct version of the data, e.g. UPDATE customer SET [name] = @newname WHERE [id] = @id AND [rowversion] = @timestamp <-- timestamp value Edbert Sydney, Australia "A day without sunshine is like, you know, night."

      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