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. C#
  4. How can I check any row of database has updated or not through update query

How can I check any row of database has updated or not through update query

Scheduled Pinned Locked Moved C#
databasehelpquestionannouncement
7 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.
  • S Offline
    S Offline
    S a n d y
    wrote on last edited by
    #1

    Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards

    S W M 3 Replies Last reply
    0
    • S S a n d y

      Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards

      S Offline
      S Offline
      Shyam K Pananghat
      wrote on last edited by
      #2

      The better option is to maintain a user session table and put an entry in it when user loggs in.. Then while logging in you can check whether that particular user id is already made an entry in the table and restrict accordingly. Remember to delete this entry on a session end or logoff

      Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .

      S 1 Reply Last reply
      0
      • S Shyam K Pananghat

        The better option is to maintain a user session table and put an entry in it when user loggs in.. Then while logging in you can check whether that particular user id is already made an entry in the table and restrict accordingly. Remember to delete this entry on a session end or logoff

        Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .

        S Offline
        S Offline
        S a n d y
        wrote on last edited by
        #3

        Thanks for reply, I have already done thats a way which you are suggested. It works perfectally in normal situation but when I login same user in two different system at same time, then the problem occurs. Both the system executes query at same time and retrives the same result from database. Thats the area where problem occurs.

        S 1 Reply Last reply
        0
        • S S a n d y

          Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Few questions: - Are you using a single database (all connections go to the same database)? - is the connection alive all the time the user is logged into the system?

          The need to optimize rises from a bad design.My articles[^]

          S 1 Reply Last reply
          0
          • S S a n d y

            Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards

            M Offline
            M Offline
            Megidolaon
            wrote on last edited by
            #5

            I don't know much about it, as I never used it myself, but maybe you could use a trigger that stores the db and row name somewhere when it's being updated and check that later.

            1 Reply Last reply
            0
            • S S a n d y

              Thanks for reply, I have already done thats a way which you are suggested. It works perfectally in normal situation but when I login same user in two different system at same time, then the problem occurs. Both the system executes query at same time and retrives the same result from database. Thats the area where problem occurs.

              S Offline
              S Offline
              Shyam K Pananghat
              wrote on last edited by
              #6

              You can use the database transactions properly to lock and allow only one user/transaction at a time. So the first user who get the access could login and the later will not. Since already one entry is there. :-D

              Shyam.. My Blog dotnetscoups.blogspot.com

              1 Reply Last reply
              0
              • W Wendelius

                Few questions: - Are you using a single database (all connections go to the same database)? - is the connection alive all the time the user is logged into the system?

                The need to optimize rises from a bad design.My articles[^]

                S Offline
                S Offline
                S a n d y
                wrote on last edited by
                #7

                - Yes, I am using a single database. - No, Connection is open before the query execution and closes after query execution. Thanks

                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