System.Data.InvalidConstraintException was unhandled

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top