Remote Database question - Adding new users & their ROLEs / Memberships
Remote Database question - Adding new users & their ROLEs / Memberships
Bear with me - newbie to all of this, but learning fast.
For Roles/Membership assignments, I seemingly have to use the VS Web Site Admin tool to populate my aspnet_roles and aspnet_membersinroles. After populating my MySql DB and creating those roles, I extracted the contents and then ran the SQL commands on my production site (via their SQL interface). Works fine.
Now the issue: I have a couple of new users that I need to add and I'm not sure the best way to do this. The ROLES created by the initial steps generated "hashed" ROLES (along with userid, etc.) So I *could* go to my ISP server and manually Add my users, but the ROLES field is hashed/terse. If I do that, should I just Copy & Paste one of the other hashed one's?
This all seems a bit convuluted and I think there MUST be an easier way. So what is the PROPER way to do this? Like I said, the ROLES appears to be hashed or something and I don't have a VS WSAT on the ISP server -- only a SQL interface to the MySql DB I created.
Thanks so much. (I have a follow-up question I'll post in a separate thread).
For Roles/Membership assignments, I seemingly have to use the VS Web Site Admin tool to populate my aspnet_roles and aspnet_membersinroles. After populating my MySql DB and creating those roles, I extracted the contents and then ran the SQL commands on my production site (via their SQL interface). Works fine.
Now the issue: I have a couple of new users that I need to add and I'm not sure the best way to do this. The ROLES created by the initial steps generated "hashed" ROLES (along with userid, etc.) So I *could* go to my ISP server and manually Add my users, but the ROLES field is hashed/terse. If I do that, should I just Copy & Paste one of the other hashed one's?
This all seems a bit convuluted and I think there MUST be an easier way. So what is the PROPER way to do this? Like I said, the ROLES appears to be hashed or something and I don't have a VS WSAT on the ISP server -- only a SQL interface to the MySql DB I created.
Thanks so much. (I have a follow-up question I'll post in a separate thread).
If I got you right, you should utilize the following functions:
Is this what you need?
Code: Select all
Membership.CreateUser("username", "password", ...) - to create a user
Code: Select all
Roles.CreateRole("rolename") - to create a role
Code: Select all
Roles.AddUserToRole("username", "rolename") - to add a user to a role
Yea, I think that's what I need ... So, as a newbiew to this, how do I "execute" those commands? Are they just SQL commands that I would run in a SQL window on the remote server? Or do I create an ASP.NET "form" that I fillout and execute those commands.. You can point me to the right spot in your documentation if that helps. I''ve been searching everything but still haven't figured this out.
Sorry for being so stupid with this, but as I said, this is very new to me and I'm REALLY REALLY trying to learn this.
Thanks again Alexey
Sorry for being so stupid with this, but as I said, this is very new to me and I'm REALLY REALLY trying to learn this.
Thanks again Alexey
OK,,,, trying... (hopefully you can see that?) see code below of my newly-created .cs file. VS is complaing about an invalid TOKEN "(" Do I need a "USING" statement that somehow points to MySqlDirect stuff???
I've searched your HELP documentation for the proper coding parameters of the Membership.CreateUser and Roles.AddUserToRole and cannot for the life of me find any reference to these commands. (I will likely be very interested to see all of the commands available to me in the future.) If you can point me to that information I will gladly try to solve this myself.
sorry,,,, and thanks again.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebApplication6
{
public class Class1
{
Membership.CreateUser("junk", "something")
Roles.AddUserToRole("junk", "member")
}
}
I've searched your HELP documentation for the proper coding parameters of the Membership.CreateUser and Roles.AddUserToRole and cannot for the life of me find any reference to these commands. (I will likely be very interested to see all of the commands available to me in the future.) If you can point me to that information I will gladly try to solve this myself.
sorry,,,, and thanks again.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebApplication6
{
public class Class1
{
Membership.CreateUser("junk", "something")
Roles.AddUserToRole("junk", "member")
}
}