Thursday, January 25, 2007

Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component ...

I've got this error message while trying to add a Database file into a c# website project :-s .
After a bit googling it appears that Visual studio 2005 is trying to connect to a SQLSERVEREXPRESS instance name, and yes this can be change easily, if like me, you have change this name during SQL server express 2005 installation. here we go:

In visual studio 2005, open the Tools menu

click on the "Options" item

Select the "Database Tools" node

Select the "Data Connections" child node

 

then you have a text box with the following label:

"SQL server Instance Name (blank for default):
"SQLSERVEREXPRESS"

for me it was just a matter of leaving it blank, and then adding a mdf file to the project is just working fine :-D

I've not found the solution anywhere else, I must be stupid... anyway, hope it helps someone.

9 comments:

Praveen Venu said...

didnt work for me

thomas.gehrmann said...

worked for me as well, thank you!!

Anonymous said...

it sooooooooooo worked for me.
thanx a whole lot
ive been on this error for the whole day...
thanx again

Anonymous said...

thank you, it worked for me.

Harold Morgan said...

What makes this work is that you put your sql express instance name in the "SQL Server Instance Name (blank for default):" textbox.

For me it was SQLEXPRESS but could be different for your installation.

How I found mine was to open my express version in SQL Server management console and get the instance name that it showed me signing on to.

Mine was "xxxxxxxxxx\SQLEXPRESS", where the x's represent my local computer name.

The string behind the "\" is your SQL Express instance name on your computer.

Anonymous said...

Thank you so much. I have been chasing this problem for the last two days. I am happy I came across your posting.

freakingschemer said...

It did not work for me too. I changed it to blank the first time and the next time I filled the default Instance Name; No result both the times.

I use VS2008 and Sql Server 2005

Charles said...

no work for me either

William said...

Worked a treat for me with Visual Studio 2008 and SQL Server 2008 after I used a different instance name. Thanks a bunch!