Name
Rule
Synopsis
This enumeration is used to specify two properties of the
ForeignKeyConstraint
class:
ForeignKeyConstraint.UpdateRule
and
ForeignKeyConstraint.DeleteRule
. The value from
this enumeration indicates what will happen to the related child rows
when a change is made to a parent row. For example, by using a
ForeignKeyConstraint.DeleteRule
or
Cascade
, all child rows are removed when the
parent row is deleted. If you use SetNull
, the
foreign key field in the child record is set to a
null
value. SetDefault
restores
the default value for the foreign key field; None
performs no action.
public enum Rule { None = 0, Cascade = 1, SetNull = 2, SetDefault = 3 }
Hierarchy
System.Object
→
System.ValueType
→
System.Enum(System.IComparable
, System.IFormattable
, System.IConvertible)
→
Rule
Returned By
ForeignKeyConstraint.{DeleteRule
, UpdateRule}
Passed To
ForeignKeyConstraint.{DeleteRule
, ForeignKeyConstraint( )
, UpdateRule}
Get ADO.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.