0
votes

I want to use role and membership provider in ASPX.NET.So when i want to add a rule using Web Site Administration Tool i got this error:

    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)

I set connectionstring as you can see here :

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

What is the problem .

Best regards

1

1 Answers

0
votes

Unable to connect to SQL Server database.

The message said it all. There are a lot of reasons you cannot connect to SQL server.

1st thing to check will be to login to SQL Server using SSMS.

Normally, you should have connection string like this in 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 are sample connection strings.