ForeignKeyConstraint problem...

Hi,

I'm using a dataset to manage an MS Access db. I create two tables, I fill them with data, and I relate two fields:

Table1:                Table2:
CustomerID         ProductID
(AutoNumber)      (Number)

But when I try to add something to table2, the child, I get this error:
"ForeignKeyConstraint Relation1 requires the child key values (1) to exist in the parent table"

Any help

Thanks


Answer this question

ForeignKeyConstraint problem...

  • Carlos González

    I think you don't have a datarow in datatable1 with a primary key value of 1.
  • ForeignKeyConstraint problem...