MS VS Dataset Designer
allows to create a relationship (a
DataRelation object) that maintains information about parent-child records in two data tables in a dataset using
Relation Dialog Box.
It has option to specify type of relationship:
Both Relation and Foreign Key Constraint
Creates both a relation and foreign key constraint (see below for descriptions).
Foreign Key Constraint Only
A ForeignKeyConstraint restricts the action performed when a value in a column (or columns) is either deleted or updated.
Relation Only
A DataRelation is used to relate two DataTable objects to each other through DataColumn objects.
The default is "Relation Only", and it causes problems, if your code modifies primary key of referenced table and you expected cascade updates.
Based on my experience, it is better to use "Both Relation and Foreign Key Constraint" and specify
Update and Delete rules as Rule.Cascade .
May be the VS Relation Dialog Box.should not specify the defaut, but force developer to make consious desision.