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. General Programming
  3. Visual Basic
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved Visual Basic
8 Posts 3 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
    PREMSONBABY
    wrote on last edited by
    #1

    [Message Deleted]

    J D 2 Replies Last reply
    0
    • P PREMSONBABY

      [Message Deleted]

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      There is no built-in way to handle concurrency issues - you must do a number of things for example: 1) Add a timestamp column to each database table 2) When loading a row update/get the timestamp 3) when saving a row compare client-side timestamp with current database timestamp 4) If they differ reject the update (or take appropriate action)

      --- How to get answers to your questions[^]

      P 1 Reply Last reply
      0
      • P PREMSONBABY

        [Message Deleted]

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

        PREMSONBABY wrote:

        i want to know is there any changes in the sql table, in the database.

        The only way to tell, and even this isn't perfect, is to load another dataset with the table your updating, then compare each record to what you have. Any differences will tell you that the data has changed. But, the data can change WHILE you're doing the compare. If you're going to use a disconnected approach like this, you'll just have to deal with the fact that the "last write wins". The last client to write to the database overwrites any and all other changes. Now, under SQL Server, there is what's called Notification Services. This allows your application to subscribe to certain events that occur in your database. SQL Server will then notify you when these events happen and your code can take appropriate action. SQL Server Notification Services[^]

        Dave Kreskowiak Microsoft MVP - Visual Basic

        P 1 Reply Last reply
        0
        • J J4amieC

          There is no built-in way to handle concurrency issues - you must do a number of things for example: 1) Add a timestamp column to each database table 2) When loading a row update/get the timestamp 3) when saving a row compare client-side timestamp with current database timestamp 4) If they differ reject the update (or take appropriate action)

          --- How to get answers to your questions[^]

          P Offline
          P Offline
          PREMSONBABY
          wrote on last edited by
          #4

          [Message Deleted]

          D J 2 Replies Last reply
          0
          • D Dave Kreskowiak

            PREMSONBABY wrote:

            i want to know is there any changes in the sql table, in the database.

            The only way to tell, and even this isn't perfect, is to load another dataset with the table your updating, then compare each record to what you have. Any differences will tell you that the data has changed. But, the data can change WHILE you're doing the compare. If you're going to use a disconnected approach like this, you'll just have to deal with the fact that the "last write wins". The last client to write to the database overwrites any and all other changes. Now, under SQL Server, there is what's called Notification Services. This allows your application to subscribe to certain events that occur in your database. SQL Server will then notify you when these events happen and your code can take appropriate action. SQL Server Notification Services[^]

            Dave Kreskowiak Microsoft MVP - Visual Basic

            P Offline
            P Offline
            PREMSONBABY
            wrote on last edited by
            #5

            [Message Deleted]

            D 1 Reply Last reply
            0
            • P PREMSONBABY

              [Message Deleted]

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

              I don't have any public domain NS code I can share. But, there are TONS of examples in the documentation for it.

              Dave Kreskowiak Microsoft MVP - Visual Basic

              1 Reply Last reply
              0
              • P PREMSONBABY

                [Message Deleted]

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

                The subject line you used IS useless. Everyone who comes here is looking for help, so putting "Help me!" in the subject line doesn't really make you stand out at all.

                Dave Kreskowiak Microsoft MVP - Visual Basic

                1 Reply Last reply
                0
                • P PREMSONBABY

                  [Message Deleted]

                  J Offline
                  J Offline
                  J4amieC
                  wrote on last edited by
                  #8

                  PREMSONBABY wrote:

                  please dont tell that it is not possible or useless

                  Where exactly did I say waht you are trying to do was "useless or impossible"?? I said your subject line was useless for the reason Dave K described. We also have an SQL / ADO.NET forum here which would have been a better place for this post.

                  PREMSONBABY wrote:

                  if u dont know something

                  I know more than something sonny. I have dealt with this particular issue (db concurrency) many many times and I gave you one (of many) solution to the problem. Dave gave a second. A simple thankyou would have been appreciated!

                  --- How to get answers to your questions[^]

                  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