Page 1 of 1
How to UPDATE a member ? Roles/Membership
Posted: Fri 04 May 2007 22:08
by Cody21
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.
Posted: Mon 07 May 2007 07:20
by Alexey
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.
Posted: Mon 07 May 2007 13:48
by Cody21
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 ...
Posted: Tue 08 May 2007 11:18
by Alexey
If you added additional fields to those tables, you should treat all modifications manually. Update statement can only affect one table.
Posted: Tue 08 May 2007 13:40
by Cody21
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.
Posted: Tue 08 May 2007 14:07
by Alexey
I hope you are not going to implement your own Membership provider.
Posted: Tue 08 May 2007 14:12
by Cody21
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????
Posted: Tue 08 May 2007 14:32
by Alexey
But how will you manage additional tables?
Posted: Tue 08 May 2007 14:35
by Cody21
SQL Update commands ... no??
Posted: Tue 08 May 2007 14:41
by Alexey
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.
Posted: Tue 08 May 2007 14:49
by Cody21
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.
Posted: Tue 08 May 2007 20:15
by Cody21
OK .. I think I now GET IT ... I should have been using the ProfileProvider model... duh ...
Thanks ..!
Posted: Thu 10 May 2007 07:14
by Alexey
Right
