Steps to install ASP.NET Membership Services database

Susanthampy
Posted by in ASP.NET category on for Beginner level | Points: 250 | Views : 14190 red flag
Rating: 4.85 out of 5  
 34 vote(s)

SQL Membership provider is mainly using for storing and retrieving user credentials for an application. This will avoid lengthy codes for user authentication from applications. There are mainly two types of Membership providers are there, SQLMembershipProvider and ActiveDirectoryMembershipProvider. For adding users, Microsoft providing a setup wizard named ASP.NET SQL Server Setup Wizard. Here I am discussing about SQLMembershipProvider.


Step 1:

Run aspnet_regsql.exe located in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 on your machine. It will open a configuration wizard as below,


Step 1























Select the Next button from the above window, it will goto another page in the setup wizard.

Step 2:

From the the second window select d database task you need to perform. On this window you can select Configure SQL Server for application services radio button or Remove application services information from an existing database.

Step2
























Then Press next button to continue.

Step 3:

In the next window you should give the name of the Server, select the authentication type( Windows authentication or Sql server authentication), if it is sql server authentication means give the user credentials and finally give the name of the database.

Step3


Press next button to proceed.

Step 4:


Select Next button and confirm your entered settings are correct.

























Step 5:

After clicking the Next button in the above window will install a application services database. Click Finish button in this window.

Step5

























In the newly created database contains some tables like users, roles etc and some stored procedures for storing, retrieving and manipulating data.

Steps to add Users into the application


Step 1:
Take web.config file. Then set the connection string(Here Database name: ASPNETServices and also provide the credentials). 
After that add authentication details such as  mode,loginurl,protection etc and authorization details.
For Example,
<authentication mode="forms">
<forms loginUrl="Login.aspx"
protection="All"
name="SqlMembershipProvider"
path="/"
requireSSL="false"
SlidingExpiration="true"
defaultUrl="Login.aspx"
cookieless="UseCookies"
enableCrossAppRedirect="false"
</authentication>
<authorization>
<deny user="?" />
</authorization>


Step 2:

Then goto Menu bar, Project/Website---->ASP.NET Configuration,
































After clicking this menu item one web page will appear like below,


aspnetwebapplicationadministration


































Step 3:

When taking security tab , it provides some options like create user, manage user, disable roles etc.

securitytab







































When clicking on the Create user link, we can add users.

Step 4:



Fill the fields and click Create user button. After that one message will appear it indicates that your account created successfully. Using the credentials we can retrieve(login) the application. Using this Asp.Net Webapplication administration, we can create users, manage users, manage roles etc.


Conclusion


SQL Membership provider is useful utility for user management. For modifying user setting we can use the Membership class, that contains some methods such as ChangePassword(), CreateUser(), DeleteUser() etc for various user management purposes. 


Reference

Page copy protected against web site content infringement by Copyscape

About the Author

Susanthampy
Full Name: Susan Thampy
Member Level: Bronze
Member Status: Member,MVP
Member Since: 4/25/2011 3:55:56 AM
Country: India
Regards, Susan
http://www.dotnetfunda.com
I am completed my graduation in BSc Computer Science from MG University on 2010 . Currently I am working as a software Engineer in ASSYST International, Cochin, Kerala.

Login to vote for this post.

Comments or Responses

Posted by: Ponnu on: 4/27/2011 | Points: 25
nice post and neatly presented..
Posted by: Susanthampy on: 4/27/2011 | Points: 25
Thank u Ponnu................
Posted by: Ravi_pinnoju on: 4/27/2011 | Points: 25
I want to create roles and memberships in ASP.NET MVC application.
Can you tell me the steps for roles and memberships in ASP.NET MVC application?


Posted by: Susanthampy on: 4/27/2011 | Points: 25
The ASP.NET MVC Website Template comes pre-configured to use SqlMembershipProvider which manages storage of membership information for an ASP.NET application in a SQL Server database.

We can manage roles and memberships in ASP.NET MVC using the above same methods.

Thanks and Regards
Susan
Posted by: Rakeshbinu on: 4/27/2011 | Points: 25
Really informative
Posted by: Susanthampy on: 4/27/2011 | Points: 25
Thanks
Posted by: Tripati_tutu on: 4/28/2011 | Points: 25
Good one...
Posted by: Jayapen on: 4/28/2011 | Points: 25
Very good article , amazing .. Onnum manasilayillaaaaa .....
Posted by: Rahultk on: 4/28/2011 | Points: 25
thanks for the article..
Posted by: Ambika on: 4/28/2011 | Points: 25
Interesting post...
Posted by: Susanthampy on: 4/28/2011 | Points: 25
Thank u Jayapen, Rahultk and Ambika
Posted by: Anjubalanc on: 4/28/2011 | Points: 25
It is good one
Posted by: Susanthampy on: 4/28/2011 | Points: 25
Thank u Anju

Regards
Susan
Posted by: Teena on: 5/2/2011 | Points: 25
Amazing............ article
Posted by: Rinuk on: 5/2/2011 | Points: 25
Not Bad
Posted by: Susanthampy on: 5/2/2011 | Points: 25
Thanks Teena
Posted by: Jayeshl on: 6/17/2011 | Points: 25
thanks friend to write this ..


from
Jayesh L
http://www.sqlassistant.blogspot.com
Posted by: Libint on: 6/17/2011 | Points: 25
aaaha ooho enthoru valiya aana mutta. enthuvadi ithu bombo.
Posted by: Susanthampy on: 6/22/2011 | Points: 25
@Libin: poda avidunnu
Posted by: Susanthampy on: 6/22/2011 | Points: 25
Welcome Jayesh
Posted by: Lakn2 on: 6/30/2011 | Points: 25
good one
Posted by: Susanthampy on: 7/1/2011 | Points: 25
Thank u Lakshmi
Posted by: Akiii on: 8/19/2011 | Points: 25
nice article Susan....
keep posting...

Thanks and Regards
Akiii
Posted by: Akiii on: 8/26/2011 | Points: 25
Hi Susan,

Can you tell me how to Create Membership tables in another database other than aspnetdb.mdf ?

Thanks and Regards
Akiii

Login to post response

Comment using Facebook(Author doesn't get notification)