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

May 21st, 2012, 03:59 AM
|
|
Authorized User
|
|
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
Chapter 14 Customizing Templates of the ListView Control
i am experiencing problems regarding this Try It Out Exercise on Chapter 14 "Customizing Templates of the ListView Control" when i run my web application it says
Code:
Could not find a part of the path 'C:\BegASPNET\Site\GigsPics\b01f17b6-90f3-4015-ba79-f5ea5443853d.JPG'.
i tried the source code downloaded with this book in folder "Chapter 14"
but it tells another error and the error message is this:
Code:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Picture_PhotoAlbum". The conflict occurred in database "C:\RALPH\9780470502211_VB_DOWNLOAD\SOURCE\CHAPTER 14\APP_DATA\PLANETWROX.MDF", table "dbo.PhotoAlbum", column 'Id'.
The statement has been terminated.
now im stuck and have nowhere to go. I have tried all the possible options and solutions that this forum provided like arranging the relationships of the diagram properly but when i looked at it, nothing's wrong and it is arranged the way it should be. same with the query string. there's nothing seems to be wrong. i checked it word by word, code by code, line by line. i am asking for assistance. thank you.
|
|

May 21st, 2012, 04:03 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
With regards to the first error: did you create the GigPics folder inside your web site in VWD?
And for the second erro: the code from the book should run fine as is; the error message you're getting seems to suggest you're calling one of the pages with an incorrect ID in the querystring (or none). Did you mix your site / database with the source from the book?
Imar
Last edited by Imar; May 21st, 2012 at 04:31 AM..
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

May 21st, 2012, 04:16 AM
|
|
Authorized User
|
|
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
i did copy some files from the book source because the frontend master page does not work so i created another masterpage for ManagePhotoAlbum. i think i did mixed some in the markup part. but in the Code Behind Part, i mannually hand coded the codes. step by step just as the book says.
|
|

May 21st, 2012, 04:21 AM
|
|
Authorized User
|
|
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
got it, the source code from the book works fine you need to create an album first then upload the picture and it works. you're right the application is calling a "null" id. now the problem left is my own code.
|
|

May 21st, 2012, 04:24 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
you need to create an album first then upload the picture and it works
|
That's correct. When al album is created, it's stored in the database, and then its ID is forwarded to the next page. That ID is then used to associated the pictures in the album.
Maybe the query string parameters don't match? E.g. maybe you pass ID and retrtieve it as AlbumID in the next page?
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

May 21st, 2012, 04:28 AM
|
|
Authorized User
|
|
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
still no good sir, i get the same error even i created the album first and then upload pics. this problem is on my own application now and not on the book. it still says:
Quote:
|
Could not find a part of the path 'C:\BegASPNET\Site\GigsPics\88b54b92-2997-4dd9-bd02-b425465e24ea.jpg'.
|
|
|

May 21st, 2012, 04:32 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
With regards to the first error: did you create the GigPics folder inside your web site in VWD?
|
Does the GigPics folder, at C:\BegASPNET\Site\GigsPics, exist on disk?
If it does, can you post the code that saves the image?
Imar
|
|
The Following 2 Users Say Thank You to Imar For This Useful Post:
|
|
|

May 21st, 2012, 04:42 AM
|
|
Authorized User
|
|
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
|
|
sir! a typo error, the folder "GigsPics" does not exist but i accidentally named it "GigPics" i changed "GigsPics" in the code with the name of the folder "GigPics" and its running perfectly. I noticed it too late. i will change the folders name properly later so that i will not messup with the upcoming Try It Out Exercises. thanks for entertaining. btw, you'r book is great. I didn't know LINQ, Entity Framework is not that hard to learn for beginners and the steps are easy to follow with clear explanations. I'll be waiting to buy for new books that you will be publishing in the future
|
|
 |
|