Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 ASP.NET
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 4-Jan-13 23:12pm
Bobyv335
Edited 6-Jan-13 23:01pm
v6
Comments
onurag19 at 5-Jan-13 5:36am
   
please explain more what do you want to do .
Bobyv at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 766
1 OriginalGriff 345
2 CPallini 200
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,795
1 Sergey Alexandrovich Kryukov 5,028
2 CPallini 4,700
3 George Jonsson 3,142
4 Gihan Liyanage 2,450


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100