Solved

Should I and can I extend the aspnet_Users table?

Posted on 2011-03-13
7
855 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

910 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

24 Experts available now in Live!

Get 1:1 Help Now