Wrox Programmer Forums
|
BOOK: Wrox's SQL Server 2005 Express Edition Starter Kit ISBN: 978-0-7645-8923-2
This is the forum to discuss the Wrox book Wrox's SQL Server 2005 Express Edition Starter Kit by Rajesh George, Lance Delano; ISBN: 9780764589232
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's SQL Server 2005 Express Edition Starter Kit ISBN: 978-0-7645-8923-2 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 April 24th, 2006, 07:26 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Master-Detail p66-8 error

The build on page 68 gives me this error in line 4:
"Handles clause requires a WithEvents variable defined in the containing type or one of its base types."

I notice that as I key in this part of line 4...
bindingNavigatorSaveItem.Click
...the popup window does not include bindingNavigatorSaveItem, but does list other, similarly named options:

bindingNavigatorAddNewItem
bindingNavigatorCountItem
bindingNavigatorDeleteItem
bindingNavigatorMoveFirstItem
bindingNavigatorMoveLastItem
bindingNavigatorMoveNextItem
bindingNavigatorMovePreviousItem
bindingNavigatorPositionItem
bindingNavigatorSeparator
bindingNavigatorSeparator1
bindingNavigatorSeparator2

I'm guessing that whatever causes SaveItem to not appear in this popup list is probably the source of the problem. Here's the code below, pretty much straight from the text except that I named the project Crouton instead of MyDB. Apart from this error all projects so far have worked like a charm. Any insights?

-------------------
Imports System.Data
Public Class Form1

    Private Sub bindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bindingNavigatorSaveItem.Click

    (rest of code removed from post after solution determined)
 
Old April 24th, 2006, 08:54 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Resolved. Got that figured out by examining the downloadable code for chapter four. The text in the book removed the word Person from PersonbindingNavigatorSaveItem in two places in line four. I had taken the directive literally in the book to copy the code as presented so I removed "Person" from the existing code.

Once I corrected that the first build gave me a weird anonymous error but a second rebuild went as smooth as silk. Able to add a new author. Would need to recheck the specs for this task but I suspect that it's not supposed to be able to add books via Form1 yet.
 
Old February 12th, 2008, 10:27 AM
Registered User
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've just been searching everywhere to find the solution to the coding error on p.66-67 of this book!
Just a point to add to the previous answer though in case anyone else looks. If you add 'person' before both sets of the bindingNavigatorSaveItem_Click it still comes up with an error when you debug the form - something to do with multiple entries or something. However, if you only add 'person' back on to the final binding phrase at the very top of p.67 - so it reads: Handles personbindingNavigatorSaveItem.Click - that seems to do the trick! I haven't a clue why but I added stuff into the database and it saved so maybe with time the reason will become clear! - This really needs to be added to the errata pages for the book!






Similar Threads
Thread Thread Starter Forum Replies Last Post
master-detail hhpatek ADO.NET 0 April 3rd, 2008 02:53 PM
Master Detail prasanta2expert Access VBA 1 October 1st, 2007 06:37 AM
master/detail page yteferi ASP.NET 2.0 Basics 6 April 12th, 2006 09:04 AM
Master/Detail page yteferi ASP.NET 2.0 Basics 1 April 5th, 2006 04:06 PM
master/detail beeyule Dreamweaver (all versions) 1 January 18th, 2005 02:59 AM





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