2014-04-23 77 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是樣本連接字符串。

相關問題