How to UPDATE a member ? Roles/Membership

How to UPDATE a member ? Roles/Membership

Postby Cody21 » Fri 04 May 2007 22:08

I've spent a week now on this confusion. What I can't seem to figure out in using the Query Builder (in VS2005) is how to create a GridView that allows me to UPDATE a Membership. This is very easy to do when dealing with a single TABLE. However with MySql Roles/Membership, there are 7 TABLES associated with a Membership ID. When I generate an UPDATE in the Query Builder in VS2005, it only allows for me to ADD 1 of the Tables. So isn't there some sort of JOIN required to do this?

How is this accomplished? Should I be using different Tools for the MySqlDirect product? or should the Query Builder be sufficient?

If you have a SPECIFIC example of MySql commands that accomplish this I would be so appreciative. Currently I have to update my members by going directly into the MySql database on the Server ... very tedious. and the 2nd half of this is how to DELETE a Member ID - given that it's associated with 7 Tables.

Thanks so much.
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Alexey » Mon 07 May 2007 07:20

What is the purpose of updating membership database? Data can be updated by calling appropriate functions from .NET code (such as AddUser, AddRole, etc.). MySQLDirect .NET itself cares of this database.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Cody21 » Mon 07 May 2007 13:48

Alexey wrote:What is the purpose of updating membership database? Data can be updated by calling appropriate functions from .NET code (such as AddUser, AddRole, etc.). MySQLDirect .NET itself cares of this database.


Yea, I noted that on earlier attempts at managing ROLES. But I couldn't find a "method" for UPDATING several fields for a member id. The UPDATE Method only updates the user's EMAIL. I have added several columns to the asp_membership table to include addition contact data. Other than directly going into the database, I don't see a way to actually update those fields -- short of generating the appropriate SQL Update statements ... and that's where I'm having trouble. (Is there a better approach to adding elements/fields to the Roles/Memebrship database? I'm all ears.)

(PS - these methods for managing roles/membership might be a handy part of your reference material .... at least for us newbies. A simple list of each method's name, what it does, and the proper approach to implement it. Not all of us are "code jockeys" ... lol ... )

Thanks Alexey ...
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Alexey » Tue 08 May 2007 11:18

If you added additional fields to those tables, you should treat all modifications manually. Update statement can only affect one table.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Cody21 » Tue 08 May 2007 13:40

OK ... I should then probably remove those added fields and create a new TABLE that contains my specific & unique additions... My ISP only allows 1 MySql database (for no additional charge). So I'm stuck using the Roles/Membership database for EVERYTHING.

Thanks for your help.
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Alexey » Tue 08 May 2007 14:07

I hope you are not going to implement your own Membership provider.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Cody21 » Tue 08 May 2007 14:12

No - my plan is to continue to use the current MySql DB for Roles/Membership ... and use the MS Methods to manage the elements. But since I'm restricted to just 1 MySQL database (by my ISP), I need 11 or 2 additonal Tables of data. I will need to have a KEY associated back to the Membership KEY (e.g., USERID). That's OK to do, right????
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Alexey » Tue 08 May 2007 14:32

But how will you manage additional tables?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Cody21 » Tue 08 May 2007 14:35

SQL Update commands ... no??
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Alexey » Tue 08 May 2007 14:41

I just wanted to say that this is beyond the scope of MySQLDirect .NET Membership provider. It is strange that membership database structure doesn't suit your needs. It was designed by Microsoft.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Cody21 » Tue 08 May 2007 14:49

OK .. duly noted ... I will take a more in-depth look at the Database and see if I can somehow make it "fit" ... e.g., the things that are missing relative to members is: Home Phone, Cell Phone, Address, City State, etc --- things I would consider BASIC Member information that someone would like to capture.

So if I'm seeing this correctly, the intent of that database is STRICTLY for Roles/Membership Authentication & management. For additonal type of data capture, we need a different database. ... but then I get into the complexity of how to relate the Roles DB with a secondary "contact info" database. Unless I can add a new Table or something to the primary ROLES database... I'm clearly missing something here. How would YOU do something like this? ... and I realize this is probably out of scope.. Just curious though.

Thanks Alexey.
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Cody21 » Tue 08 May 2007 20:15

OK .. I think I now GET IT ... I should have been using the ProfileProvider model... duh ...

Thanks ..!
Cody21
 
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Postby Alexey » Thu 10 May 2007 07:14

Right :)
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL