Solved

Should I and can I extend the aspnet_Users table?

Posted on 2011-03-13
7
850 Views
Last Modified: 2012-06-21
Hi, I'm using asp.net 3.5 and C#
After a user logs in, I need to know if this user has completed an initial form if not then send the user to that form.  I only need a column with bookean value indicating this.  Should I put this in a separte database table or can I extend this table/
Also, I have a couple other tables that records data collected from these forms for each users.  I need to link the logged in user to these tables using something like userid.  Should I create these tables using the aspnet_Users userid?    If not, should I just use the logged in user's email address as key?  Thanks.
0
Comment
Question by:lapucca
7 Comments
 
LVL 2

Expert Comment

by:sihar86
ID: 35124835
Sorry, I don't understand the last sentence.
What is the relation of user's email address with other table?
Could you explain the structure of the table?
0
 

Author Comment

by:lapucca
ID: 35124897
I'm trying to find a way to store information for each of the logged in user,  So let's say I have a table named form1.  I want to look up form1 entry that's related to the logged in user.  What do you recommend for me to use to link the logged in user to the table.  I mean which column in aspnet_Users table should I use as a Froeign Key in the form1 table.  Thanks.
0
 
LVL 11

Assisted Solution

by:SAMIR BHOGAYTA
SAMIR BHOGAYTA earned 200 total points
ID: 35125468
Hi, try this example

For example: Creating the user:

Code below shows the creation for user in aspnet user table and get the aspnetuserId and pass it as input parameter on your insert stored procedure to link the added user to your table in your database.

// insert the user in aspnet users.

MembershipUser usr = Membership.CreateUser(Username, Username, Email);

string aspnetUserId = "{" + usr.ProviderUserKey.ToString() + "}";

Guid gdAspnetUserId = new Guid(aspnetUserId);

// insert in your users table

UsersTableAdapter UserTA = new UsersTableAdapter();

UserTA.SP_Users_Insert(gdAspnetUserId, Username, Email, Address); //Your Paramaters

more on this link

http://www.c-sharpcorner.com/uploadfile/dsdaf/aspnetuserprofileextend09292006172529pm/aspnetuserprofileextend.aspx
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Accepted Solution

by:
Kelmen earned 300 total points
ID: 35125587
if you use the table, you better prepare some unit-test code to test your changes, in case whenever some service-pack update recreate the table.
you need maintainance/checking plans/procedures for any changes/patches by m$.

if you create your own table, separate database, it will be more fault-tolerance, but performance will be sacrifice. if your user data is not huge, this is recommended. do yourself a performance test to justify it. you may need to implement replication since the data is in separate db.
0
 

Author Comment

by:lapucca
ID: 35125627
For that one column one bit data I want to add that to the aspnet_Users table.  How would I retrieve that?  Using regular ado.net?  Can I query aspnet_Users table?
I have more data collected from several forms that the user completed.  Those data are definintely going into a separate database.  I'm trying to find out how do i link the logged in user to this database's tables.  What key/info should I use to do this?  Thanks
0
 
LVL 5

Expert Comment

by:Kelmen
ID: 35146548
i assume this "aspnet_Users" table/db, is a sample by m$.

i dunno how the existing packaged asp sample/code doing their stuffs.

if they retrieve directly from the table, you must modify your sql to include your new column
if through stored-proc, then a bit more work, i sure you know what to do.

for your separate db, as long as you have the column to store the user unique id, you don't really need linkage/reference to the aspnet_Users, as it will be bad for performance.
you need to concern if a user is deleted from the table, how you gonna maintain that on your separate db:
- either you don't bother, but provide a script/maintenance/schedule-plan which you will remove deleted user in your separate db when cross checking the aspnet_Users, cross db query is not hard.
- you can lookinto using replication, assuming your separate db don't provide user maintenance feature through ui, the user maint is straightly done in the aspnet_Users database.
0
 

Author Closing Comment

by:lapucca
ID: 35152292
Thank you.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now