+ Post New Thread
Results 1 to 8 of 8
Windows Thread, When connecting to a database I get told the file is already in use in Technical; Hi, In Visual c# express I am trying to connect to a database but I keep getting told that database ...
  1. #1
    My220x's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    257
    Thank Post
    9
    Thanked 3 Times in 3 Posts
    Blog Entries
    8
    Rep Power
    14

    When connecting to a database I get told the file is already in use

    Hi,

    In Visual c# express I am trying to connect to a database but I keep getting told that database is already in use when it isnt, how do I fix this?

  2. #2

    elsiegee40's Avatar
    Join Date
    Jan 2007
    Location
    Kent
    Posts
    10,793
    Thank Post
    1,789
    Thanked 2,180 Times in 1,615 Posts
    Rep Power
    771
    Access databases have a locking file that is created when someone uses it. Sometime that gets left behind and needs deleting manually. Is this the sort of thing you need to be looking for perhaps?

  3. #3
    My220x's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    257
    Thank Post
    9
    Thanked 3 Times in 3 Posts
    Blog Entries
    8
    Rep Power
    14
    i am using sql server 2005 express.

  4. #4

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,143
    Thank Post
    863
    Thanked 2,695 Times in 2,285 Posts
    Blog Entries
    9
    Rep Power
    772
    Have you made sure that you can connect to the database initially by enabling TCP/IP in the SQL Server Configuration Manager. You could also try restarting the SQL server service for the instance that you are using.

  5. #5
    My220x's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    257
    Thank Post
    9
    Thanked 3 Times in 3 Posts
    Blog Entries
    8
    Rep Power
    14
    I have enabled TCP/IP but now I get a different error.
    Attached Images Attached Images

  6. #6

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,143
    Thank Post
    863
    Thanked 2,695 Times in 2,285 Posts
    Blog Entries
    9
    Rep Power
    772
    Did you make the database manually of let Visual studio do it for you. I would suggest creating the DB in VS as it will handle all of the linking and file permissions. It looks like that database may be corrupted or have invalid file permissions that the SQL Services user account can't open.

  7. #7
    My220x's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    257
    Thank Post
    9
    Thanked 3 Times in 3 Posts
    Blog Entries
    8
    Rep Power
    14
    I have now created it via Visual C# Express and it works fine

  8. #8

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    There can be a problem with the Visual Studio database explorer - when you use that to look at the tables etc it doesn't seem to co-operate nicely with your running code. Close the object browser (restart the SQL Server service if necessary) and things should work again.

    I've seen this before and it's a real pain - it's documented somewhere in the MS KB but I don't think they see it as a bug!

SHARE:
+ Post New Thread

Similar Threads

  1. Connecting to a folder
    By faza in forum How do you do....it?
    Replies: 11
    Last Post: 29th May 2008, 07:48 PM
  2. Replies: 4
    Last Post: 28th February 2007, 09:37 AM
  3. PHP flat file database script
    By ajbritton in forum Web Development
    Replies: 3
    Last Post: 26th October 2006, 08:51 PM
  4. SIMS Database & Log File
    By indiegirl in forum MIS Systems
    Replies: 14
    Last Post: 17th March 2006, 03:00 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •