System.Data.ForeignKeyConstraint.DeleteRule Property

Gets or sets the action that occurs across this constraint when a row is deleted.

Syntax

[System.ComponentModel.DefaultValue(System.Data.Rule.Cascade)]
public virtual Rule DeleteRule { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When a row is deleted from a parent table, the ForeignKeyConstraint.DeleteRule determines what will happen in the columns of the child table (or tables). If the rule is set to Cascade, child rows will be deleted.

If set to SetNull, a DBnull will be placed in the appropriate columns of the affected rows. Depending on your data source, a null value may or may not be permitted in a column. For example, SQLServer allows multiple null values to be found in a primary key column, even if they are not unique. In a System.Data.DataTable, however, if a System.Data.DataColumn object's DataColumn.Unique property is set to true, multiple null values are not allowed in primary key columns.

If set to SetDefault, the default value for the column is assigned.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0