 |
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
|
|
|
|
|

June 24th, 2011, 01:35 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> However, can you tell me at what stage I went wrong?
I don't know, really. The only difference I could see was the missing relationship between the two entities.
Maybe you can do it the other way around? E.g. tell me what you did exactly, and then maybe we can figure out what went wrong.
BTW: Do you have Service Pack 1 installed? I wrote the book against RTM so it shouldn't really make make a difference but maybe you're running into an issue that has been fixed.
Quote:
|
Oh, the University is taking my recommendation and we'll be using your book as a text. I just have to develop a curriculum around it and some test banks, etc.,
|
If there's some material you'd like to share with me for a review, that would be great. I use my own book in training sessions from time to time and would love to have some additional training material.
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

June 24th, 2011, 04:35 PM
|
|
Registered User
|
|
Join Date: Jun 2011
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
|
|
OK. Great! I made the changes and got that page to work, but now I can't add multiple photos t6hrough the NewPhotoAlbum.aspx page. I added one new album, one photo, then an error. So I started over and added another album and one photo, then the error. Now I get the error before I can even add a first photo. It's the same error I originally contacted you with, however, I just got home from Las Vegas and with the above happening on the way down there, I ran it again here and everything works correctly!
I don't know why the intermittent bug, but I'll watch it.
I'm going to redo the entire website and third time and see if I can find any problems that I did wrong.
I did redo the entire PhotoAlbums page following your directions, and my VS automatically created the Source="it.ID ......".
I'm using VS 2010 Ultimate version 10.0.30319.1 RTMRel with .NET Framework Version 4.0.30319 RTMRel. Visual Basic 2010 -01019-532-200210-7098.
I haven't received any notification of a service pack release on VS Ultimate, but will check into it. Perhaps you're completely right that it's a bug in my particular release of VS.
Anyway, Thanks for the help on this issue and I'll continue and keep you informed of anything I might come up with.
Your response and professionalism is appreciated. I'll be looking for more Wrox books from you and getting those, possibly into the University as well.
|
|

June 24th, 2011, 04:39 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I don't think Windows Update notifies you of VS 2010 updates. Just in case: you can download it from here: http://www.microsoft.com/downloads/e...a-ef22627e57a5
Cheers,
Imar
|
|

June 24th, 2011, 08:58 PM
|
|
Registered User
|
|
Join Date: Jun 2011
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
|
|
MY APOLOGIZES. I installed the SP1 update and now it seems that everything works correctly.
I'll keep at it.
Thanks again!
|
|

June 25th, 2011, 06:28 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great. Glad it's working now.
Quote:
|
If there's some material you'd like to share with me for a review, that would be great. I use my own book in training sessions from time to time and would love to have some additional training material.
|
Is this something you're willing to consider?
Imar
|
|

June 25th, 2011, 10:40 AM
|
|
Registered User
|
|
Join Date: Jun 2011
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
|
|
Yes I am. I'm going to finish your book completely, then review the areas where I "fouled" up and then start working on making a curriculum and test banks. I'll let you know of my progress.
|
|
The Following User Says Thank You to david.rowley For This Useful Post:
|
|
|

April 11th, 2013, 09:08 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ch 14 p521
Hi Imar,
I read this thread with interest as I had exactly the same problem.
If you follow the book exactly it will work. My difficulty was that when building the Picture data table, instead of column name "PictureAlbumId" as per your detailed instruction I created column name "PictureAlbumID". Note that I used uppercase for "ID". When setting the "Where" parameters for the EntityDataSource, I inserted "PictureAlbumId" as per the book. That's where it breaks. I changed the Where Control Parameter Name value to "PictureAlbumID" and it worked. Saved having to rebuild the data tables.
Just another example of the case-sensitive nature of ASP.net code.
For a newbie, your book is a great place to start.
Nick
|
|

April 11th, 2013, 11:11 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> Saved having to rebuild the data tables.
Yeah, indeed. You could have fixed it at the database and model level as well, but I think this was much quicker ;-)
>> Just another example of the case-sensitive nature of ASP.net code.
I think it's C#, not ASP.NET. I think this would have worked if you were using VB....
Cheers,
Imar
|
|

April 12th, 2013, 01:23 AM
|
|
Authorized User
|
|
Join Date: Mar 2013
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
I too am getting this error...
A property with name 'PhotoAlbumId' does not exist in metadata for entity type 'PlanetWroxModel.PhotoAlbum'.
after creating the datapager control on pg 544.
no idea what the problem is cos i believe i made the tables right.
EDIT: I copied the default.aspx from the resources and put them into my build and the page showed up as it should.
so it's something in my default.aspx then.
EDIT2: now whenever i try to add more than 1 image it gives me this error...
Violation of PRIMARY KEY constraint 'PK_Picture'. Cannot insert duplicate key in object 'dbo.Picture'. The duplicate key value is (0).
The statement has been terminated.
Last edited by thgh0sts; April 12th, 2013 at 02:28 AM..
|
|

April 12th, 2013, 02:44 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Looks like you have a few things mixed up. If it works with my files, the database and model are indeed fine. My guess is that it is in the way you're passing the album ID from the new album page to the picture page.
Can you post the markup and code behind of ManagePhotoAlbum.aspx and NewPhotoAlbum.aspx? When you post the code, can you please paste it in Notepad first to remove color coding and then use the forum editor's Code toolbar button to wrap your code in code tags. Otherwise, this forum messes up the code.
Cheers,
Imar
|
|
 |
|