I am developing an ASP.NET MVC3 application using,
- MS SQL Server Pro 2008
- MS VS 2010 pro
- Entity FrameWork as model class.
When i start ASP.NET Web Site Administration Tool by clicking ASP.NET Configuration from solution explorer, in Security tab it shows an error:
Unable to connect to SQL Server database.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config has a connection string as,
<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
I opened the C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe and configure the database default named 'aspnetdb'. But situation is not being improved. So, would you please help me to solve it. Thank you.
Have you tried the database server that Visual Studio attempts to use?
It should match the one specified in your web.config file.
To check to go: Tools -> Options -> Database Tools -> Design-time Validation Database.
You can then change the SQL Server instance which is used.