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. Closing an open database connection when debugging starts

Closing an open database connection when debugging starts

Scheduled Pinned Locked Moved C#
databasehelpcsharpsysadmincollaboration
5 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.
  • D Offline
    D Offline
    dabs
    wrote on last edited by
    #1

    Hi, I'm not sure this problem belongs here, but this is probably just as good a place as any for it. Anyway. I'm working on a solution (written in C#) which uses the SQL Express database. I'm working with it in the Server Explorer, but the problem is that each time I start debugging, I must first manually right-click the connection to the database in the Server Explorer and select "Close Connection". Otherwise I get an error when I try to connect to it using my app (which is a web application, not sure if that matters). Which becomes quite annoying after some time. Is there a way to automatically close the connection when I start debugging? Or do you use some other method altogether? Regards, Daníel


    Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

    J 1 Reply Last reply
    0
    • D dabs

      Hi, I'm not sure this problem belongs here, but this is probably just as good a place as any for it. Anyway. I'm working on a solution (written in C#) which uses the SQL Express database. I'm working with it in the Server Explorer, but the problem is that each time I start debugging, I must first manually right-click the connection to the database in the Server Explorer and select "Close Connection". Otherwise I get an error when I try to connect to it using my app (which is a web application, not sure if that matters). Which becomes quite annoying after some time. Is there a way to automatically close the connection when I start debugging? Or do you use some other method altogether? Regards, Daníel


      Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

      J Offline
      J Offline
      Justin Perez
      wrote on last edited by
      #2

      I have never had that problem, or heard of it. You might want to search google. Sounds like a strange bug to me.

      I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

      D 1 Reply Last reply
      0
      • J Justin Perez

        I have never had that problem, or heard of it. You might want to search google. Sounds like a strange bug to me.

        I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

        D Offline
        D Offline
        dabs
        wrote on last edited by
        #3

        Yup, strange indeed. Google didn't give me anything useful, but then again I'm not the best at selecting search terms. Are you using SQL Express? Regards, Daníel


        Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

        J 1 Reply Last reply
        0
        • D dabs

          Yup, strange indeed. Google didn't give me anything useful, but then again I'm not the best at selecting search terms. Are you using SQL Express? Regards, Daníel


          Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

          J Offline
          J Offline
          Justin Perez
          wrote on last edited by
          #4

          Yes I am using SQL Express, and vs 2005. Are you using VS 2003? what is the error message you are recieving?

          I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

          D 1 Reply Last reply
          0
          • J Justin Perez

            Yes I am using SQL Express, and vs 2005. Are you using VS 2003? what is the error message you are recieving?

            I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

            D Offline
            D Offline
            dabs
            wrote on last edited by
            #5

            I'm using VS2005 as well. I get the error when I try to open the database in code, and the actual error message is just a simple: "Cannot open database "" requested by the login. The login failed. Login failed for user ''. .Net SqlClient Data Provider" Daníel


            Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

            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