Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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 July 8th, 2011, 11:00 AM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile Store UserId rather than UserName

Dear Imar,
I am back after a great amount of time. But when I got back to your book then I had few questions in mind.

We have been using normalization. We store Id of any element rather its name, so that it could be reflected quickly in dependent tables when ever there is change in name of that element.
But I wanna ask that why you have not stored UserId in the PhotoAlbum table in place of OwnerName (user name)? However there is no need to change user name but no every boss is same.
So is storing UserId not convenient? What you recommend strongly and why?

Thanks in advance.
 
Old July 9th, 2011, 05:39 AM
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, you're absolutely right. It would make a lot of sense to use the ID so you can link the two records to each other.

However, at the stage where you implement this feature in the Planet Wrox site, the photo album and the use are stored in two separate databases. This makes it difficult to display the user's name along with the album as you need to do a join between two databases. Only in the last chapter are the two databases merged into a single one, enabling the scenario you're describing.

So, if you have a single database, storing just the user id pointing back to a Users table absolutely makes sense.

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!
 
Old July 11th, 2011, 08:19 AM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Default

Hi Imar,

thanks for your response. I will check the last chapter again to have a clear view of joining two databases.

Once again thanks and best of luck with your recently opened new company...





Similar Threads
Thread Thread Starter Forum Replies Last Post
UserId In table ? Riderman BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 August 8th, 2009 03:56 AM
Query based on UserName when UserId is the Primary key Spider Visual Web Developer 2008 2 March 3rd, 2009 07:56 AM
Get my Anonymous username or userID Maxxim ASP.NET 2.0 Professional 7 October 21st, 2007 08:17 AM
UserId/Computer Name mrookey Dreamweaver (all versions) 1 August 2nd, 2005 11:47 AM
UserId/Computer Name mrookey SQL Server ASP 1 August 2nd, 2005 07:23 AM





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