ASP.NET网站管理安全性部分:无法连接到SQL Server数据库 [英] ASP.NET Web Site Administration Security section: Unable to connect to SQL Server database

查看:69
本文介绍了ASP.NET网站管理安全性部分:无法连接到SQL Server数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MS VS 2013和MS SQL Server 2014开发ASP.NET应用程序。当我通过CMD启动ASP.NET网站管理工具并单击安全选项卡时,我收到以下错误:



您选择的数据存储存在问题。这可能是由无效的服务器名称或凭据或权限不足引起的。也可能是由于角色管理器功能不存在单击下面的按钮以重定向到您可以选择新数据存储的页面。



以下消息可能有助于诊断问题:无法连接到SQL Server数据库。



我的web.config设置:



 <  配置 >  
< connectionStrings >
< add name = newsdbConnectionString

connectionString = 数据源=(LocalDB)\ v11.0 ; AttachDbFilename = | DataDirectory | \ newsdb.mdf; Integrated Security = True; Connect Timeout = 30

providerName = System.Data.SqlClient / >
< / connectionStrings >
< system.web >
< < span class =code-leadattribute>编译 debug = true targetFramework = 4.5 >
< assembly >
< add assembly = < span class =code-keyword> System.Data.Linq,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = B77A5C561934E089 / >
< / assemblies >
< / compilation >
< httpRuntime targetFramework = 4.5 / >
< / system.web >
< / configuration >

有什么问题。

解决方案

再次检查您的凭据。

您的.mdb文件应该存在于项目文件夹中,如路径中所述

I am developing an ASP.NET application using MS VS 2013 and MS SQL Server 2014. When i start ASP.NET Web Site Administration Tool by CMD and click on security tab, I get below error:

" 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. "

my web.config setting:

<configuration>
  <connectionStrings>
    <add name="newsdbConnectionString"

     connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\newsdb.mdf;Integrated Security=True;Connect Timeout=30"

  providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5"/>
  </system.web>
</configuration>

What is the problem .

解决方案

Check your credentials once again.
And your .mdb file should be present in the project folder as described in your path.


这篇关于ASP.NET网站管理安全性部分:无法连接到SQL Server数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆