Groups | Blog | Home
all groups > asp.net > february 2007 >

asp.net : Using ASP.NET 2.0 log in controls - Creating the first user


Matt Adamson
2/26/2007 11:29:05 PM
Guys,

I'm thinking of using the various log in controls ASP.NET 2.0 provides e.g.
the CreateNewUserWizard. However my first question is how do I get a new
user into the system initially to actually log in and create new users?

Should I use SQL to directly insert a user record into the aspnet_Membership
and aspnet_User tables or use the API to create a new user with an admin
type role?

Best Regards

Matt

Matteo Migliore
2/27/2007 1:17:15 AM
Hi!

[quoted text, click to view]

You can create a new user through the CreateUserWizard control or
the "Administrative Application" from VS2005, "Website - ASP.NET
Configuration".

[quoted text, click to view]

Yes, you can call directly the store procedure of the ASPNETDB database:
SqlCommand command1 = new SqlCommand("dbo.aspnet_Membership_CreateUser",
holder1.Connection);
(use Reflector to get the complete code)

You can create a user by code using this code:
Membership.CreateUser(...);

To manage rules you should use the same tool, the "Administrative
Application" provided by
VS2005.

[quoted text, click to view]

Matteo Migliore.
AddThis Social Bookmark Button