My220x Posted July 19, 2008 Posted July 19, 2008 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?
elsiegee40 Posted July 19, 2008 Posted July 19, 2008 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?
SYNACK Posted July 19, 2008 Posted July 19, 2008 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.
My220x Posted July 19, 2008 Author Posted July 19, 2008 I have enabled TCP/IP but now I get a different error.
SYNACK Posted July 19, 2008 Posted July 19, 2008 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. 1
My220x Posted July 19, 2008 Author Posted July 19, 2008 I have now created it via Visual C# Express and it works fine
srochford Posted July 20, 2008 Posted July 20, 2008 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!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now