Visual Studio 2010 Database Browser won't connect to SQL Server consistantly


I've looked at the other sort of similar questions here and none seem to have a usable answer for me. I am perplexed at the error message I am getting - its a database - it's supposed to allow multiple processes to access it. What else is the point of having a database?!?

OK. Find my zen like calm again...

  Visual Studio 2010 Express (C# in this particular case)
  SQL Server 2012 R0 set up for windows authentication
  i7 based PC, 8 cores, 16GB RAM, Windows 7 Pro x64

I have a database I created with a few simple tables. I know where the MDF file is. I can access it via SQL Server Management Studio just fine.

Here is what Microsoft says to do:

Step 9 is where it fails with the error that the file is in use. That's it. No way past this point. Why isn't there a way to indicate the SQL Server - why do I have to go to the file? Is the file supposed to be totally disconnected from the running SQL Server process? How does that make sense? That is just insane - how are other processes supposed to be able to reach it? Isn't that the point of having a database? The Dude does not abide!

Theory - this is how Microsoft wants to get me to upgrade from Express to something I pay for. [insert mandatory gray beard grumble about Microsoft]. I notice that in Visual Studio for pay the Database Browser is replaced with the Server Browser... I smell a fish.

Before you answer:
  Yes. I turned it off then on again.
  Yes. I uninstalled then reinstalled the database.
  Yes. I did that other thing you suggest to users you normally don't trust to flip
    on a light switch correctly.
  Yes. This facility was cleared out of voodoo, gremlins and black cats ages ago.
    There is plenty of natural sunlight so the bastards aren't coming back.


I found the answer. It is not hard but the solution is hidden in a tricky place! You have to open up Visual Web Developer, open your solution there, and add a LINQ to SQL class. Web Developer has access to SQL Server. Once set up it should be easy to use.

For more details see it here!

Connecting to SQL Server with Visual Studio Express Editions

This video can help you solving your question :)
By: admin