Wrox Programmer Forums
|
BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8
This is the forum to discuss the Wrox book Wrox's Visual Basic 2005 Express Edition Starter Kit by Andrew Parsons; ISBN: 9780764595738
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-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 11th, 2009, 03:05 PM
Registered User
 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7 ConstraintException

This forum looks dead. I hope I'm wrong because I REALLY need some help with part of the Try It Out for Chapter 7.

I'm on step 21- running the application after I just setup everything to load the FirstName and LastName into the listbox. I keep getting an error on this line of the LoadListBox sub:
Code:
PersonListAdapter.Fill(PersonListTable)
The error I get is "System.Data.ConstraintException was unhandled
Message="Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.""

After reading this, I immediately checked the tables in PO-Data.mdf, but everything looks exactly as it should. For the Person table: ID is set as Primary Key and as Identity; POUserID has a foreign key relationship setup with the POUser table. The ID field of POUser is setup as identity and primary key.

According to the StackTrace, the error occurs at System.Data.DataTable.EnableConstraints()

I downloaded the code from this site and ran the book's code for Chapter 7, connected to the book's version of the database and got the exact same error!

Any ideas?
 
Old February 12th, 2009, 09:14 AM
Authorized User
 
Join Date: May 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CreganTur;
Hi mate firstly i think your in for a lot of problems with this book i got to chapter 10 before giving up. The forum is dead and help will be limited. My advice is try something different however as i said i reached chapter 10 so if you still insist on carrying on with the book i will try to help but a look at the code you have would help. It is hard to help you solve a problem without first knowing what the problem is





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM
'System.Data.ConstraintException' - HELP PLEASE AlanBell ADO.NET 1 July 1st, 2003 02:23 AM





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