connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.

I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.
 I have two SQL Server instances installed.
 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)
But when i try to add a database to my VS website project I get the following error:
Connection 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:
I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)
and changed the "SQLEXPRESS" to "USERLT\SQL2005".
But I still get the same error message. Any ideas how i can resolve this issue?
6/10/2007 4:16:15 PM
📃 29906 articles.

💬 10 Replies

Attach the files to your SQL server instance using for example the SQL management Studio and change your connectionstring to connect into this database.

ASP.NET Hosting (HostingFest)
6/10/2007 4:44:32 PM

Well the thing is that I dont have a database created yet. I am trying to create a new database. If i create a database in SQL 2005 then my connectionstring will point to the database on sql server. I need the database to reside in the VS project like a stand alone .mdf file so that I can deply the database with my project.
 Does that make sense? Thanks for your help.
6/10/2007 5:00:49 PM

You may open your Machine.Config file (the file is in %SystemRoot%\Microsoft.NET\Framework\ver. number\CONFIG ). Try to find the ConnectionString node, modify the setting and make it look like
<add name="LocalSqlServer" connectionString="data source=UserLT\SQL2005;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

Michael Jin.
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
6/12/2007 9:16:46 AM

<add name="LocalSqlServer" connectionString="data source=.\MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
Pasted above is the connectionStrings portion of my machine.config file.  I changed data source=.\MSSQLSERVER from SQLExperess.  However, I still cannot fix my issue.  Am I using incorrect syntax?
3/18/2008 4:36:11 AM

Hello, I just had SQL Server 2005 installed over my old SQL 2000 , and I am experiencing the same problem when I try to create a new mdf file in my App_Data. I am curious if anyone has the solution to this problem?
4/30/2008 3:54:26 PM

no i couldn and still having the same problem. In fact it says "connections to SQL server files(*.mdf) requires sql server express 2005 to function properly. Please verify the installation of the component or download from the url:" .And i am using sql management studio 2005
8/13/2008 3:55:01 PM

 As far as i know a .mdf file is not supported by SQL Server 2005 only SQL Server Express.
10/3/2008 4:18:33 AM

I tryed in Tools>Options>DataBase tools>Data Connection>Sql Server Instance Name as blank i.e, (blank for default)
And worked me fine..
11/3/2008 9:53:04 PM

Replacing the entry in Machine.Config didn't work.
I found two copies of machine.config on drive c:\ I modified both entries by changing the server name. I still get exactly the same error.
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly.
Of course, I also replaced the server name in the projects web.config file.
This is just bizarre.  PS. The server I want to use is a SQL 2008 developer instance. All my *.config files refer to that.
3/15/2009 11:38:34 AM

It just gets more and more facinating.
I restared the machine and logged on as a different user.
The machine.config entries were both OK (using the name of my new Sql 2008 Developer server).
Attempting to add a new database still gave the same error.
I noticed that there were also:
'machine.config.default' files still had the name of the defunct server (SQLEXPRESS). I changed it.
I created a new web project. The web.config of the new project was still referring to "SQLEXPRESS" as the ApplicationServices connectionString. Where is it getting SQLEXPRESS from?
"Add New Item, Data, Sql Server Database" still gives the same error message.
By this time I'd completely lost confidence in my ability to control my computer. I did a global search for the string "SQLEXPRESS" on drive C:
There were 74 files, 7 folders found. Which of these bastards is the culprit?  Or is the fault to be found in the registry?  If so where? and why?
3/15/2009 12:47:28 PM