3

I installed on a Vista x64 machine Visual Studio 2008 SP1 (with integrated SQL from the installation package) and when I try to add an MDF file to a project or to the App_Data when working with web, I get the following message:

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.

Just to make sure: SQL 2005 express is installed and I connect to it via SSMS.

Update: I am 90% sure that this is a Microsoft bug with x64 machines.

1
  • We are using x64 for development, and have no issues about not being able to connect to sql server 2005. Why do you think this is a x64 problem? If you really are sure, why don't you just drop x64 and install x86?
    – Sam
    Jul 22, 2009 at 9:02

7 Answers 7

1

Are you sure you installed SQL Server 2005? Try to check your program files folder.

C:\Program Files\Microsoft SQL Server

Versions (subfolder):

  • 80 = SQL Server 2000
  • 90 = SQL Server 2005
  • 100 = SQL Server 2008

Also check if the "SQL Server (SQLEXPRESS)" service is installed (in services.msc - the Windows Services panel).

2
  • I am maybe not so smart as I think I am, but I am not that stupid you make me. Jun 27, 2009 at 20:54
  • Sorry, I didn't want to offend you, but sometimes when you are in a hurry or you're new to a technology, these things happen.
    – splattne
    Jun 27, 2009 at 21:15
1

Visual Studio can't use .MDF files except via SQL Server Express. If you've got SQL Server Standard (or better) installed, you need to connect to the database server, not to the .MDF file.

Depending on the order that you installed things in, SQL Server Express may not have been installed by the Visual Studio installer. Your question implies that you did install SQL Server Express, but then talks about "SQL Server" (which is a different beast).

1

I know that there is a bug in VS2008 when working with .mdf files on x64 machines but I've only seen this with SQLExpress2008, but maybe they are related.

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361718

Also make sure that the data connections settings are correct in VS under Tools->Options->Database Tools->Data Connections (should be .\sqlexpress)

0

Check the following:

  • SQL Server service is running
  • Visual Studio defaults to the SQLEXPRESS instance. If you have a named instance, configure it at Tools > Options > Database Tools > Data Connections
1
  • Checked. I think the problem is that it's x64. Jun 27, 2009 at 20:56
0

Uninstall SQL 2005 (most likely got an x64 version which won't work well with VS for some reason. Download the x86 for WoW version of SQL 2005 or 2008 Express (do not use the web installer) and install it. Make sure you've got SP1 for VS2008 if you went with SQL 2008 Express. Then finally delete the old SQL Express data directories in your %localappdata% folder and try it out.

0

I am not sure if this is your problem, but i post it anyway.

If you install SSE after you install VS, VS may not be pointed at the right instance of SQL Server. The local data functionality (so you can copy around MDFs like MDBs) is associated exclusively with SSE.

(I found this in url below, but it is about VS2005) http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/6503fe05-4d05-49e7-8c2a-b9778ab7e9b8

0

IM ON WINDOWS 7 ULTIMATE X64 BITS - WITH VS PRO 2008 + NET FRAMEWORK 3.5 SP 1 + SQL SERVER 2005 SP 3 X64 BITS I DONT NOW TO NEED INSTALL SQL SERVER 2008 ITS TOO LATE FOR ME NOW, OK IM ON THE MIDDLE OF ALL THE FORMULAS DESCRIBED ON INTERNET, IF THE HOTFIX AND SP 1 COULDNT FIX THIS ISSUE I WILL VERY HUNGRY CAUSE I HAVE 3 DAYS UPDATING DOWNLOADING ETC....

BTW IV NOTICED THAT ITS READY TO TEST VS 2010 IM GOING BE CRAZY....

1
  • My eyes.............. ARGH!
    – Pure.Krome
    Aug 24, 2009 at 5:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .