"Unsolvable" bug in Visual Studio - how do I connect to SQL Server 2008 Express?
Asked Answered
N

3

6

I've been struggling for some time now to be able to use the built-in functions in Visual Studio 2008 to handle *.mdf database files with SQL Server 2008 Express. I'm running on an x64-based system, and I've read that there is a known problem with this setup, but the hotfix has not solved my problems.

Basically, what happens is that when I try to add a new *.mdf file to the App_Data folder of a project, I get an error message saying:

Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to 
function properly.  Please verify the installation of the component or download 
from the URL:    http://go.microsoft.com/fwlink/?LinkId=49251

My (unsuccessful) steps to solve this:

  1. Uninstall all possible associated programs to Visual Studio, SQL Server or .NET Framework (which left .NET 2.0 Compact Framework and .NET 3.5 Compact Framework, and nothing else .NET related, installed).
  2. Reboot.
  3. Install .NET 3.5 SP1, SQL Server 2008 Express and SQL Server Management Studio 2008 Express via the Web Platform Installer 2.0 (Beta).
  4. Reboot.
  5. Install Visual Studio 2008 Professional from disc.
  6. Reboot.
  7. Install Visual Studio 2008 Service Pack 1.
  8. Reboot.
  9. Install hotfix.
  10. Reboot.
  11. Start VS, create new Web site and try to add database. Still get the error message...

When I look in the Help/About dialog, the hotfix shows up among applied updates. I have also checked and double-checked that the SQL Server instance name is correctly set in Visual Studio (I copy-pasted the instance name from the login screen in SSMS).

Why does the hotfix not solve my problems? Am I doing things in the wrong order, or do I have the wrong software versions somewhere?

According to the KB article, the problem is that Visual Studio doesn't correctly detect "some registry keys" - but nothing is said about which keys. Does anyone know how to fix this manually?


Oh, and yes - I've seen this post. I know I could just "downgrade" to the x86 version of SQL Server, but I really want to make this work with the x64 version (if nothing else, just because it's supposed to work...), so that solution doesn't really solve my problems. Please don't close this as a duplicate.

Niple answered 8/6, 2009 at 12:40 Comment(7)
I'll ask there too, and update so that the solution is available in both places.Niple
doesn't belong on serverfault, as this is CLEARLY programming related.Xenophanes
also probably belongs on MSFT support forums IMO.Xenophanes
MSFT? You guys and acronyms... ;)Niple
+1 After 2 days of fiddling (Vista x64)I gave up and installed SQL Server 2005 instead. I would be glad if someone could answer this.Threepiece
Nifle, you could still use the x86 version of SQL Server 2008 if you wanted to (I will, very soon...). I just think it's stupid that I pay for an x64 environment, and then some bug in MS software prevents me from utilizing it.Niple
They haven't been able to solve it on the MSFT forums yet either.Violinist
N
0

I'm not sure I ever solved this, but I've now moved over to Visual Studio 2010 (RC at the moment, but I'll get the full version when it's availabel) and everything works seemlessly.

Niple answered 5/4, 2010 at 15:4 Comment(0)
R
2

I had this same error, VS 2008 SP 1 on Vista Ultimate 64 bit with SQL 2008 Express 64 bit. Downloaded the hotfix and rebooted, started up SQLEXPRESS and still got the error.

Then I changed my "SQL Server Instance Name" (under VS 2008 -> Tools -> Options -> Data Connections), which was blank, to "SQLEXPRESS" (versus ".\SQLEXPRESS", which is what I use in my login screen under SSMS.) and now it works like a charm!

  • Dave
Revel answered 8/6, 2009 at 19:49 Comment(0)
A
0

Try changing the user on which the SQL Server Express is running. This can be changed in Services managment (press Win+R, type in services.msc). Choose SQL Server Express, right click -> Properties. 'Log On' tab and select: 'Local System account', tick the 'Allow service to interact with desktop' - this is what worked for me.

Adactylous answered 8/6, 2009 at 13:3 Comment(2)
is the service running at all?Adactylous
Yes, no problems. I can connect to the server instance from the Server Explorer tab in VS too, as long as the *.mdf file is attached in SSMS. But I can still not create *.mdf files in the App_Data directory.Niple
N
0

I'm not sure I ever solved this, but I've now moved over to Visual Studio 2010 (RC at the moment, but I'll get the full version when it's availabel) and everything works seemlessly.

Niple answered 5/4, 2010 at 15:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.