Click here to Skip to main content
15,886,815 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When i was creating Web Site Administration (WSA) Tool, i was not able to connect to sql server database.

i was creating role based user membership application. clicking on option website->asp.net configuration, it took me to WSA. and when i clicked on security tab, error occured.

Home --- Security --- Application --- Provider

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.

When i click on Choose Data Store this page opens and shows like this...

Use this page to configure how Web site management data such as membership is stored. You can use a single provider for all the management data for your site or you can specify a different provider for each feature.

Your application is currently configured to use the provider: AspNetSqlProvider

Select a single provider for all site management data
Select a different provider for each feature (advanced)


When i click on first link, it appears as,

Use this page to select a provider for storing site management data.


Provider
AspNetSqlProvider Test


The fact is that i con not connect application to the database.

Help me to resolve this.
Posted
Updated 6-Jan-13 23:01pm
v6
Comments
[no name] 5-Jan-13 5:36am    
please explain more what do you want to do .
Bobyv 5-Jan-13 5:41am    
i was creating role based user membership application. clicking on option website->asp.net configuration, it took me to WSA. and when i clicked on security tab, error occured
OriginalGriff 5-Jan-13 5:40am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

To use role based membership
you need SQL server installed, either separate server or part of Visual Studio installation on your machine.( SQLExpress is free download).

Then you need to create a database. Blank one.

Now you need to setup the aspnet security services in the new database using the tool:

"To launch the aspnet_regsql.exe tool, go to the start menu and choose Run. Enter %WINDIR%\Microsoft.Net\Framework\v2.0.50727\aspnet_regsql.exe into the textbox and click OK. Alternatively, you can use Windows Explorer to drill down to the appropriate folder and double-click the aspnet_regsql.exe file. Either approach will net the same results."
From: http://www.asp.net/web-forms/tutorials/security/membership/creating-the-membership-schema-in-sql-server-vb^

Add the connection string to this new database in web.config.

Change the authentication section in web.config to mode="Forms".

Inside system.web section add

<rolemanager enabled="true">
      <providers>
        <clear />
        <add applicationname="/">
             connectionStringName="YourConnectionStringName"
             name="AspNetSqlRoleProvider"
             type="System.Web.Security.SqlRoleProvider" />
      </add></providers>
    </rolemanager>
    <membership userisonlinetimewindow="20">
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider">
             connectionStringName="YourConnectionStringName"
             type="System.Web.Security.SqlMembershipProvider"/>
      </add></providers>
    </membership>


Now try WSA Tool.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900