Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I was going to add .mdf database file to my asp.net project file, but while adding it shown me this error
"Connection to SQL database files(.mdf)require SQL server 2005 express or SQL server 2008 express to be installed and running on the local computer, The current version of SQL server can be download on this liink http://..." But i have already installed full version of SQL server 2008.. What should i do now...?

What I have tried:

I installed sql server express but still can't add .mdf database to my project...
Posted
Updated 2-Sep-16 19:36pm

On Visual Studio
> Go to Tools
> Options
> Database Tools
> Data Connections
Clear the SQL Server Instance Name (blank for default) option and write SQLEXPRESS
 
Share this answer
 
The solution is simple. you can do that easily..
On this path C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Machine.config. based on .NET framework version you are using. There is an entry to the localserver database, change the datasource to that name from where datasource you got the .mdf file..

currently in your case, in the machine config, the localsqlserver datasource name and the the .mdf data source name seem to be different and so the error..

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900