views:

248

answers:

3

Hi everyone,

This might be a pretty basic question, but how do you add new users to the aspnet_Users table in a ASP.Net 2.0 app?

I know I could do it using a SQL script, and being mindful of the associations, but I know I've seen a graphical interface for it... I can't find code for adding new users in the web app I'm maintaining (it might be in there but I can't find it).

Can anyone point me in the right direction?

Let me know if you need more info!

-Ev

A: 

I always used SQL Mgmt Studio.

Cheeso
Thanks Cheeso. how exactly do you add them in through there?I was thinking something like:[DatabaseName] -> Security -> Users -> new userOr something, but I can't see it...?
Ev
no - that will add a user for the database. You want to add a row into the db table. I don't recall the table name now, or the schema, but... browse to the appropriate tables and you can insert the rows you need.
Cheeso
+1  A: 

Hi, In Visual Studio, in the solution explorer on the right, there should be an "ASP.NET Configuration" icon (Looks like the world and a hammer). Click on that and you can configure your site via its GUI. If your just adding basic users to the table, this would be an easy way. However, it does mean you have to create accounts for them manually. Usually, I'd stick to SQL script or SQL Management Studio (as Cheeso) pointed out.

keyboardP
@TenaciousImpy: Ah thanks a lot for that! That might be what I'm looking for. I'll check it out, but I can see one problem with just using a script - how do i get the encoded password/password salt?
Ev
@Ev - Sorry, I should clarify, I didn't mean strictly SQL script. Although it is possible to do so because the required stored procedures are installed when you have an ASP.NET database. These stored procedures are called when you use the standard Membership API. Therefore, all I did was directly call the procedures in some cases (such as when I wanted to change the username of a user). Of course, this isn't necessary, but it was part of a learning experiment for me.
keyboardP
@TenaciousImpy: Perfect. Exactly what I needed to know! Cheers!!!
Ev
A: 

If you're using VS.Net, go to Website > asp.net configuration

ScottE