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. Why the exception "Could not save; currently locked by another user" raise?

Why the exception "Could not save; currently locked by another user" raise?

Scheduled Pinned Locked Moved C#
helpdatabasequestionannouncement
4 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.
  • N Offline
    N Offline
    nicolus
    wrote on last edited by
    #1

    When i tried to update the contents of a table in my database using oledbcommand i am getting the "Could not save; currently locked by another user" exception. I tried closing the connection other places where ever it is used. But still the same problem is coming? what should i do? Please help me?

    C N 2 Replies Last reply
    0
    • N nicolus

      When i tried to update the contents of a table in my database using oledbcommand i am getting the "Could not save; currently locked by another user" exception. I tried closing the connection other places where ever it is used. But still the same problem is coming? what should i do? Please help me?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I assume this is an access db ? How many connections does your code have ? Why does it have more than one ?

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      N 1 Reply Last reply
      0
      • N nicolus

        When i tried to update the contents of a table in my database using oledbcommand i am getting the "Could not save; currently locked by another user" exception. I tried closing the connection other places where ever it is used. But still the same problem is coming? what should i do? Please help me?

        N Offline
        N Offline
        Nouman Bhatti
        wrote on last edited by
        #3

        If u r the only one using that db than surely there's a place left in your code where db connection left open.

        1 Reply Last reply
        0
        • C Christian Graus

          I assume this is an access db ? How many connections does your code have ? Why does it have more than one ?

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          N Offline
          N Offline
          nicolus
          wrote on last edited by
          #4

          Thanks for the reply, Exactly i am using access. Actually my code calls internally some services which are also using the same connection and upto my knowledge they are getting closed as soon as the service use is finished. Or otherwise is there any way to view all the connections which are open?

          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