Wednesday, February 4, 2015

This constraint cannot be enabled as not all values have corresponding parent values in c#?

You have created two data tables here(table1, table2).
 
and in both table there is some values, which you are selecting from database..
In your table there is some data which is producing confliction.. Try to remove the conflict between both..
 
or else just change a line in your code and try 
ds.Relations.Add("FK", ds.Tables(0).Columns("ContractorID"), ds.Tables(1).Columns("ContractorID"))

No comments:

Post a Comment