Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
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 May 21st, 2012, 03:59 AM
Authorized User
 
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
Default 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.
 
Old May 21st, 2012, 04:03 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,

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
__________________
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; May 21st, 2012 at 04:31 AM..
The Following User Says Thank You to Imar For This Useful Post:
rmanapul (May 21st, 2012)
 
Old May 21st, 2012, 04:16 AM
Authorized User
 
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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.
 
Old May 21st, 2012, 04:21 AM
Authorized User
 
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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.
 
Old May 21st, 2012, 04:24 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:
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
__________________
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:
rmanapul (May 21st, 2012)
 
Old May 21st, 2012, 04:28 AM
Authorized User
 
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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'.
 
Old May 21st, 2012, 04:32 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:
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
__________________
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 2 Users Say Thank You to Imar For This Useful Post:
rmanapul (May 21st, 2012)
 
Old May 21st, 2012, 04:42 AM
Authorized User
 
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Examples - Chapter 4 - Using Control Templates [email protected] BOOK: Beginning Windows Phone 7 Application Development: Building Windows Phone Applications Using S 6 May 2nd, 2012 05:51 AM
CH14 Customizing Templates of the ListView Control (image issue) agiusthomas BOOK: Beginning ASP.NET 4 : in C# and VB 3 April 16th, 2012 03:15 PM
Ch 14 Customizing Templates of the ListView Control leeWozyWarren BOOK: Beginning ASP.NET 4 : in C# and VB 3 December 4th, 2011 06:16 AM
Chapter 14, Listview control problem SamuelMSr BOOK: Beginning ASP.NET 4 : in C# and VB 3 September 28th, 2011 02:47 PM
Chapter 14 Calendar Control sajhak ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 12:11 PM





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