Multiple foreign key constraints and cascading updates result in constrain violation exception
I have recreated the problem in a tiny project, which can be downloaded here:http://fedot.stockworm.com/misc/XSD.zip
Please note, that an Exception is thrown when the following line of code is executed:
dataSet.Brand[0].BrandName = "Nissan"; |
Also note, that removing foreign key constraint between Color and ModelColor elements eliminates the Exception and performs all foreign key updates properly. However, I am trying to understand why I cannot keep that key and still have everything working right.
Please download the project, execute it, and see everything for yourself. Thank you in advance for hopefully shedding some light on this problem.

