简体   繁体   中英

Web Site Administration Tool:Unable to connect to SQL Server database

I am developing an ASP.NET MVC3 application using,

  1. MS SQL Server Pro 2008
  2. MS VS 2010 pro
  3. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM