Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't Visual Studio 2008 create .mdf files with SQL Server 2008 Developer installed?

I'm trying some of the ASP.NET MVC tutorials and one of them has the following steps:

  • Right-click on the "App_Data" folder, and choose "Add New item"
  • Choose "SQL Server Database" under the "Data" category.

However, once I do that, I get the following message from Visual Studio:

Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function proprely. Please verify the installation of the component or download from the URL...

The thing is that I have SQL Server 2008 Developer Edition installed, and I would really rather not install any Express versions (2005 or 2008) if I don't have to. Is there a work-around for this issue?

like image 469
Jedidja Avatar asked Nov 16 '08 00:11

Jedidja


People also ask

Which SQL Server is compatible with Visual Studio 2008?

Since SQL Server 2008 is not supported in Windows 10, we have to upgraded it to SQL Server 2017 or SQL Server 2019.

How do I add an MDF file to Visual Studio?

In Visual Studio, open the project without upgrading it. To run the project, select the F5 key. To edit the database, open the . mdf file in Solution Explorer, and expand the node in Server Explorer to work with your database.

How do I get MDF from SQL Server?

This is the path where you will find MDF file If you are in Visual Studio, go to SQL Server Object Explorer. Find the database you want, right click and select properties. In the properties tab, look for Data File, next to it will be the location for your mdf file. Save this answer.

How do I create an MDF file?

mdf file by opening the Properties window of the data connection: Select View > SQL Server Object Explorer to open the SQL Server Object Explorer window. Expand (localdb)\MSSQLLocalDB > Databases, and then right-click on SampleDatabase. mdf and select Properties.


1 Answers

I ran into this problem too on 64-bit Windows 7 (using 64-bit SQL Server Express 2008).

There are two methods of fixing this problem referenced in the Microsoft Support Knowledge Base article:

1. Workaround

To work around this problem, uninstall the 64-bit version of SQL Server Express 2008, and then install the 32-bit version of SQL Server Express 2008.

If you don't want to do the uninstall/install, then try the Hotfix method below.

2. Hotfix

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

Although the article itself doesn't include a link to the hotfix, you can get it here: http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=957944

like image 104
Ken Avatar answered Oct 21 '22 08:10

Ken