Applying DeleteRule even though EnforceConstraints is false?

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

Hi!

Is it bug or didn't I get it right, that when
DataSet.EnforceConstraints==false no Rules (in
ForeignKeyConstraints) are applied? MSDN
says: "Constraints are not enforced unless the
EnforceConstraints property is set to true." (c) but I
see, that when I remove row in parent table (through
DataRowCollection.Romove), related rows in child table are
also removed even though EnforceConstraints is false...
Bug or feature?

Thanks!
 
Hi Ed,

This is handled separately I guess - it is a matter of DataRelation and
Rules.
ForeignKeyConstraint defines two rules in this regard: InsertRule and
UpdateRule.
Both of them are still enforeced, however you might temporarily disable
them.
 
Thank you! But how can I disable them besides setting
DeleteRule to None? Is there the way to disable all
ForeignKeyConstraint at once?
 
Back
Top