Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old June 24th, 2011, 01:35 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

>> 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
__________________
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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
david.rowley (June 24th, 2011)
  #12 (permalink)  
Old June 24th, 2011, 04:35 PM
Registered User
 
Join Date: Jun 2011
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default

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.
Reply With Quote
  #13 (permalink)  
Old June 24th, 2011, 04:39 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
__________________
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!
Reply With Quote
  #14 (permalink)  
Old June 24th, 2011, 08:58 PM
Registered User
 
Join Date: Jun 2011
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default

MY APOLOGIZES. I installed the SP1 update and now it seems that everything works correctly.

I'll keep at it.

Thanks again!
Reply With Quote
  #15 (permalink)  
Old June 25th, 2011, 06:28 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
__________________
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!
Reply With Quote
  #16 (permalink)  
Old June 25th, 2011, 10:40 AM
Registered User
 
Join Date: Jun 2011
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default

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.
Reply With Quote
The Following User Says Thank You to david.rowley For This Useful Post:
Imar (June 26th, 2011)
  #17 (permalink)  
Old April 11th, 2013, 09:08 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #18 (permalink)  
Old April 11th, 2013, 11:11 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

>> 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
__________________
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!
Reply With Quote
  #19 (permalink)  
Old April 12th, 2013, 01:23 AM
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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..
Reply With Quote
  #20 (permalink)  
Old April 12th, 2013, 02:44 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
__________________
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!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click event not firing for Dynamic button control when it has validation control Gayathri79 ASP.NET 3.5 Basics 5 August 20th, 2010 06:58 PM
datapager for programatic listview digink BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 June 1st, 2010 02:07 AM
Datapager in Listview monika.vasvani ASP.NET 3.5 Professionals 0 March 10th, 2010 05:45 AM
Datapager in Listview monika.vasvani ASP.NET 3.5 Professionals 0 March 9th, 2010 09:31 AM
DataPager & PlaceHolder positions jsymons BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 September 25th, 2009 07:50 AM



All times are GMT -4. The time now is 11:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.