Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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 February 14th, 2009, 02:08 PM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB Tools.Log error, Chapter 13

Hi,

I've just finished testing the try it out Checking Out for Chapter 13 on page 509. On page 515 this code is listed:

Code:
Catch
Code:
 SqlEx As Exception
'some form of error - rollback the transaction and rethrow the exeption
If trans IsNot NothingThen
trans.Rollback()
End If
'Log the exception
Tools.Log("An error occurred while creating the order", SqlEx)
Throw New Exception("An error occurred while createing the order", SqlEx)
Return
Finally...


When I run the progam I get a build error telling me that the name Tools is not declared. If I comment out this line I get throught the chechout process and when I click finish I'm directed back to an error in VWD. The word 'Finally' is highlighted, and the error text is:

System.Exception was unhandled by user code
Message="An error occurred while createing the order"
Source="App_Web_uuw4qglq"
StackTrace:
at Checkout.Wizard1_FinishButtonClick(Object sender, WizardNavigationEventArgs e) in C:\BegASPNET2\Downloaded Chapters\Chapter13\Begin\Chapter13\Checkout.aspx.v b:line 111
at System.Web.UI.WebControls.Wizard.OnFinishButtonCli ck(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Obj ect source, EventArgs e)
at System.Web.UI.WebControls.Wizard.WizardChildTable. OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="App_Web_uuw4qglq"
StackTrace:
at Checkout.Wizard1_FinishButtonClick(Object sender, WizardNavigationEventArgs e) in C:\BegASPNET2\Downloaded Chapters\Chapter13\Begin\Chapter13\Checkout.aspx.v b:line 51
InnerException:

I checked the code for the end of Chapter 13 and in place of the Tools.Log and Throw lines there's a comment:

'TODO log error

It seems the author couldn't be bothered to correct the errors in his code. Anybody have any ideas what's happening with the code?

Last edited by Roosker; February 14th, 2009 at 02:14 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13 Error Psyclist BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 12 February 15th, 2010 07:49 PM
LINQ Error ? Chapter 13 workidoo BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 July 22nd, 2008 09:37 AM
Chapter 13 - vb ganesh_jai BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 January 15th, 2007 12:36 PM
Chapter 13 VB Version michaelcode BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 August 10th, 2006 10:07 AM





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