0

Let's say I have a customer parent table and an orders child table. I set createconstraints to true for the datarelation, and I also add foreignkeyconstraints for delete and update to cascade. All works as expected. Now let's say the number of customer records gets so large I have to load only subsets of the customer records into the dataset. However, the number of order records is still manageable, so I continue to load them all in. When adding the datarelation if an order exists and I didn't happen to load in the parent customer record I get an error. So I try to set the createconstraints of the datarelation to false. Now the datarelation will load, but I get an error when trying to add a foreignkeyconstraint.
Since I will work only with the customer records that are currently loaded in the dataset, and essentially ignore any order records whose parent customer record is not present, how can I do this and still have the benefit of the foreignkeyconstraint cascading my deletes and updates? I guess I could only load the order records whose parent is present, but I was looking for an easier way. Thanks for any advice.

Ron V
  • 11
  • 4

0 Answers0