2014-04-23 76 views
0

我想使用ASPX.NET.So作用和成员提供程序时,我想补充使用网站管理工具规则我得到这个错误:无法连接到数据库,网站管理工具

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) 

我设置的ConnectionString,你可以在这里看到:

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

有什么问题。

问候

回答

0

Unable to connect to SQL Server database.

消息说这一切。有很多原因无法连接到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是样本连接字符串。

相关问题