Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : 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 January 6th, 2014, 05:38 PM
Authorized User
 
Join Date: Aug 2011
Posts: 44
Thanks: 14
Thanked 0 Times in 0 Posts
Default Chapter 13 - Handle SqlException

Hello Imar,

in chapter 13, in the Genres GridView, I'm trying to handle the following SqlException:

The DELETE statement conflicted with the REFERENCE constraint "FK_Review_Genre".

The exception occurs if the user try to delete a Genre with at least a Review still attached.

I cannot understand where to put the try/catch because the stack trace in the Yellow Screen of Death does not show up any aspx page of the Planet Wrox site.

Can you tell me where to put the try/catch to handle this DB exception ?

Thank you
 
Old January 6th, 2014, 05:41 PM
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,

Do you have custom errors enabled? What do you see instead?

Is the Genre deleted after all?

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:
Antonius Block (January 6th, 2014)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13 Try It! MikersSU BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 11 April 1st, 2012 05:14 AM
Chapter 7, Fig 7-11c: IE7 and Firefox 3 handle border-collapsing differently mwatso BOOK Beginning CSS: Cascading Style Sheets for Web Design, 2nd Ed; ISBN: 978-0-470-09697-0 1 June 17th, 2009 07:59 PM
Chapter 13 bwoll BOOK: Beginning Access 2003 VBA 1 June 7th, 2007 03:57 PM
Chapter 13 ElMorenito BOOK: Beginning ASP 3.0 0 January 14th, 2005 02:56 PM





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