【问题标题】:failed to connect to database in Web Site Administration Tool无法连接到网站管理工具中的数据库
【发布时间】:2014-04-23 14:20:56
【问题描述】:

我想在 ASPX.NET 中使用角色和成员资格提供程序。所以当我想使用 网站管理工具 添加规则时,我收到了这个错误:

    The following message may help in diagnosing the problem: Unable to connect to SQL 
Server database. at 
System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership,
 String methodName, Object[] parameters, Type[] paramTypes) at 
ASP.security_users_manageusers_aspx.Page_Load() at 
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at 
System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at
 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean 
includeStagesAfterAsyncPoint)

我设置了你可以在这里看到的连接字符串:

<membership defaultProvider="AspNetSqlMembershipProvider"> 
  <providers> <clear /> 
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="authentication" />

有什么问题。

最好的问候

【问题讨论】:

    标签: asp.net asp.net-membership


    【解决方案1】:

    无法连接到 SQL Server 数据库。

    消息说明了一切。无法连接到 SQL Server 的原因有很多。

    要检查的第一件事是使用 SSMS 登录 SQL Server。

    通常,您应该在 web.config 中有这样的连接字符串。

    <connectionStrings>
       <remove name="authentication" />    
       <add name="authentication" connectionString="Data Source=192.168.1.100;Initial Catalog=DATABASE_NAME;Persist Security Info=True;User ID=DATABASE_USERID;Password=DATABASE_PASSWORD;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    </connectionStrings>
    

    Here 是示例连接字符串。

    【讨论】:

      猜你喜欢
      • 2010-11-29
      • 2013-06-27
      • 2011-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-30
      • 1970-01-01
      相关资源
      最近更新 更多