Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 December 8th, 2010, 10:24 AM
Authorized User
 
Join Date: Dec 2010
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
Default Chapter 11 Page 378 - Creates one to one relationship

Hi,

Compliments on an excellent guide.

I have another issue. I follow the steps on page 378 of the guide using Web Developer 2008 and SQL server 2008 express and it creates a one to one relationship between the Genre and review tables. How do I change it to a one to many relationship?

EDIT: Sorted it. I have to not select Review ID as a primary key. Surely if we start to use high volumes of data that will slow the database down?

Last edited by GeeTee991100; December 8th, 2010 at 10:29 AM..
 
Old December 8th, 2010, 10:36 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
EDIT: Sorted it. I have to not select Review ID as a primary key. Surely if we start to use high volumes of data that will slow the database down?
Hi there,

You definitely want to keep Review.Id as the primary key of the Review table so the problem must be elsewhere.

Maybe you were trying to join Genre.Id on Review.Id rather than on Review.GenreId?

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!

Last edited by Imar; December 8th, 2010 at 11:23 AM..
 
Old December 8th, 2010, 10:42 AM
Authorized User
 
Join Date: Dec 2010
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
Default

Definitely not got the order wrong.

If I select the Review ID as a primary key it reverts back to a one to one regardless of which order I place the table. I've played around with it, changed the order and tried quite a few things and it always creates a one to one relationship but as soon as I deselect Review ID as a primary key it reverts to a one to many. Could it be a SQL 2008 express issue?

EDIT: Just tried creating the same diagram in SSMS 2008 express and I get the same issue. Do you know anyway of getting around this? Thanks.

Last edited by GeeTee991100; December 8th, 2010 at 11:00 AM..
 
Old December 8th, 2010, 11:17 AM
Authorized User
 
Join Date: Dec 2010
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
Default

HI,

I am still having the same issue. Do you know of any forum I can look at that might have a solution?

Thnaks
 
Old December 8th, 2010, 11:21 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
but as soon as I deselect Review ID as a primary key it reverts to a one to many.
To me that seems as if the database tries to join both primary keys (Genre.Id on Review.Id) instead of a primary key and a foreign key (Genre.Id and Review.GenreId).

Quote:
Definitely not got the order wrong
Not sure what you mean with that. What "order" are you talking about?

Quote:
Could it be a SQL 2008 express issue?
I don't think so; the entire book was written and tested against SQL Server Express. For this particular feature, there shouldn't be a difference between 2005 and 2008.

When you drag Genre.Id to Review.GenreId, two dialog boxes pop up as explained in the book. What do you see in the top most window? That is, what does it list as Primary key table and Foreign key table, and which columns does it list for these tables?

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 December 8th, 2010, 11:22 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Do you know of any forum I can look at that might have a solution?
You're in the right forum already. Just tell me what you do and see and I can help you make this work.

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:
GeeTee991100 (December 8th, 2010)
 
Old December 8th, 2010, 11:33 AM
Authorized User
 
Join Date: Dec 2010
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
Default

Sorry, by order I thought you meant I was trying to join review first to genre second. With Review as the primary key table table and Genre foreign key. I was pointing out that no matter which way I did it I was still getting the same result.


The pop up is as follows.

http://i156.photobucket.com/albums/t...T_02/diag1.jpg
 
Old December 8th, 2010, 11:36 AM
Authorized User
 
Join Date: Dec 2010
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
Default

Ooops I see it now. I was joining id to id. Sorry for the mistake. Thanks for the help
 
Old December 8th, 2010, 11:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Ooops I see it now. I was joining id to id.
Exactly what I thought. Glad it's working now.

Quote:
by order I thought you meant I was trying to join review first to genre second.
FYI, it shouldn't matter in what order you do this. SQL Server should be able to figure out the relationship with both options.

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:
GeeTee991100 (December 8th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 11 Page 354 skijor BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 August 9th, 2009 08:02 AM
Errata - Chapter 10, Page 378, C# RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 August 31st, 2006 09:56 AM
Chapter 10, Try It Out pp375-378, C# - Not Working RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 August 31st, 2006 09:31 AM





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