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?