I am inserting a user using membership provider
protected void Button3_Click(object sender, EventArgs e)
{
MembershipCreateStatus status;
MembershipUser user = Membership.CreateUser("chandu1", "P@ssw0rd", "rasdsd@sdsdh.com", "null", "null", true, out status);
switch(status)
{
case MembershipCreateStatus.DuplicateUserName:
Response.Write("User already exists in system.Please select different name and try again");
break;
case MembershipCreateStatus.DuplicateEmail :
Response.Write("Duplicate Email");
break;
case MembershipCreateStatus.Success :
Response.Write("User has been created successfully");
break;
}
But i am unable to find the user in the membership table or users table where can i find them?.How membership provider determines in which database it should insert the user,i am new to this can anyone help me?
if you use a ASP.net website, you’ll need to look at the Web.Config, if you use an other kind of project you need to take a look at the App.Config
These files are the places where they store the connectionstring to lets say a DB
Part of a web.config
As you can see here there is the connectionstring which will tell the membershipprovider where to look for the Database or file.
next to that there are some Nodes in you Web.Config that tell something about the authentication mode and membershipprovider.
If you want to use the ASP.netDB for saving users/roles take a look at the Aspnet_regsql command that can be found in the %windir%\Microsoft.NET\Framework\VersionNumber
Here another nice example of how to create an asp.net MVC2 website using Forms authentication
Have fun 🙂