简体   繁体   English

无法访问ASP.NET配置工具

[英]Cannot Access To ASP.NET Configuration Tool

When I want to access to ASP.NET Configuration Tool it gives me the following error message: 当我想访问ASP.NET配置工具时,它会显示以下错误消息:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. 

The following message may help in diagnosing the problem: Unable to connect to SQL Server database.

What can I do. 我能做什么。 Is there any configuration which I should set before I can access or ? 在访问之前,是否应该设置任何配置?

I am using ASP.Net MVC4 Project with build in connection string. 我正在使用带有内置连接字符串的ASP.Net MVC4项目。

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-AccountPortal-20131128183241;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-AccountPortal-20131128183241.mdf" providerName="System.Data.SqlClient" />

you should access your connection string from web.config file before proceeding further. 您应先从web.config文件访问connection string ,然后再继续操作。

web.config file : web.config文件

<connectionStrings>
  <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-AccountPortal-20131128183241;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-AccountPortal-20131128183241.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>

from code : access connection string which is in web.config file 来自代码 :访问连接字符串,位于web.config文件中

string connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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