In order to incorporate Membership files to an existing database, follow the following steps:
Prior to this steps, we assumed that you have the information of the existing database and have Administative rights.
1. Back up MS SQL Database (existing and aspnetdb).
2. Execute the executable file below:
C:\Windows\Microsoft.NET\Framework\v2.(something)\aspnet_regsql.exe
3. "ASP.NET SQL Server Setup Wizard" will pop-up. Click "Next".
4. Select the first option. (Second option enables you to remove all Membereship files from the existing database). Click "Next".
5. Type the Database Server Name, and select the database you want to add the Membership files. Click "Next".
6. Check the existing database, you now can see all the Membership files (tables) you need. Basically, all the tables you have on the aspnetdb.mdf.
7. Now, as our last step, we need to change a little few things on the web.config of the project. "YourConnectionStringName" is the name of you connection string under the <connectionstring> node.
Notice the sample code below:
3. "ASP.NET SQL Server Setup Wizard" will pop-up. Click "Next".
4. Select the first option. (Second option enables you to remove all Membereship files from the existing database). Click "Next".
5. Type the Database Server Name, and select the database you want to add the Membership files. Click "Next".
6. Check the existing database, you now can see all the Membership files (tables) you need. Basically, all the tables you have on the aspnetdb.mdf.
7. Now, as our last step, we need to change a little few things on the web.config of the project. "YourConnectionStringName" is the name of you connection string under the <connectionstring> node.
Notice the sample code below:
Under <system.web>, search for roleManager node;
Before:
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="YourConnectionStringName" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
After:
<roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
<providers>
<add connectionStringName="YourConnectionStringName"
name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>
Under <system.web>, search for membership node;
Before:
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="YourConnectionStringName"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
After:
<membership defaultProvider="CustomizedMembershipProvider">
<providers>
<add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="YourConnectionStringName"/>
</providers>
</membership>
8. Run and test to make sure that the Membership provider is working properly. Open the "ASP.NET Web Site Administration Tool" on your Visual Studio. Go to menu, select "Project" and then click the "ASP.NET Configuration". On this window, you should be able to view or manage your user in information.
L.
L.





2 comments:
Ι love what you guys are usually up too. Ƭhis soгt of clever work аnd rеporting!
Keеp up the terrific works guys I'vе incorporated yߋu guys tօ blogroll.
My web-site kompresory tłokowe
Thank you for the comment. Feel free to check the other posts. :)
Post a Comment