首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法访问ASP.NET配置工具

无法访问ASP.NET配置工具
EN

Stack Overflow用户
提问于 2013-12-01 23:23:25
回答 1查看 84关注 0票数 0

当我想访问ASP.NET Configuration Tool时,它会给出以下错误信息:

代码语言:javascript
复制
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.

我能做什么。在访问或之前,是否有我应该设置的配置?

我正在使用带有内置连接字符串的ASP.Net MVC4项目。

代码语言:javascript
复制
<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" />
EN

回答 1

Stack Overflow用户

发布于 2013-12-02 00:39:21

在继续之前,您应该从web.config文件访问您的connection string

web.config文件

代码语言:javascript
复制
<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>

来自代码的:访问web.config文件中的连接字符串

代码语言:javascript
复制
string connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20313731

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档