Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2016, 12:20 PM
Registered User
 
Join Date: Feb 2016
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default Chapter 16: Linking Users IDs to Different Tables

So if I follow the guidelines in Chapter 16 and use the Membership Application Service to manage my users, I see that each user gets an unique UserID in the database (accessible by "ProviderUserKey" property of the the Membership User class).

I want to make my own database tables that point to this user. If I make another table in the same database, it seems like using this key is the appropriate way to point to my user. Based on the discussions in Chapter 12, it would make sense to mark such a reference as a foreign key.

But then I got nervous, is it ok to do that? Could making a reference into the membership table mess things up in ways I don't yet understand?

Thanks.
 
Old March 6th, 2016, 02:42 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Yes, it's OK to do. The users tables are just tables in your database, so it's OK to refer to them.

Instead of referring to its internal ID, you could also point to the user's User Name as that can be a unique key too.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
ErikWW (March 7th, 2016)





Similar Threads
Thread Thread Starter Forum Replies Last Post
linking tables elainemurphy2 PHP Databases 2 March 4th, 2011 06:35 AM
Linking pivot tables iacon Excel VBA 3 July 24th, 2006 01:25 AM
Access2000 Linking Tables Rchanga Access 1 December 21st, 2004 05:49 PM
Linking Tables usedcarsgbcom Beginning PHP 4 November 23rd, 2004 08:46 PM
Linking Tables Con Access VBA 2 September 24th, 2003 04:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.