System.Data.InvalidConstraintException was unhandled

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a windows form app created in c# that uses an access database. When I
add a record in a form with a relation I receive the following error,

System.Data.InvalidConstraintException was unhandled
Message="ForeignKeyConstraint FK_Parent Company_Payments_Commis requires
the child key values (20) to exist in the parent table."

However when I look at the data in Parent Company 20 DOES EXSIST! So what's
the problem? If I remove the restraint in the dataset it allows the record to
be added but I wont it to signal an error when the parent table REALLY
doesn't have the added number.

Thanks in advance
 
Back
Top