ForeignKeyConstraint.AcceptRejectRule 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
호출될 때 AcceptChanges() 이 제약 조건에서 수행해야 하는 작업을 나타냅니다.
public:
virtual property System::Data::AcceptRejectRule AcceptRejectRule { System::Data::AcceptRejectRule get(); void set(System::Data::AcceptRejectRule value); };
[System.Data.DataSysDescription("ForeignKeyConstraintAcceptRejectRuleDescr")]
public virtual System.Data.AcceptRejectRule AcceptRejectRule { get; set; }
public virtual System.Data.AcceptRejectRule AcceptRejectRule { get; set; }
[<System.Data.DataSysDescription("ForeignKeyConstraintAcceptRejectRuleDescr")>]
member this.AcceptRejectRule : System.Data.AcceptRejectRule with get, set
member this.AcceptRejectRule : System.Data.AcceptRejectRule with get, set
Public Overridable Property AcceptRejectRule As AcceptRejectRule
속성 값
값 중 AcceptRejectRule 하나입니다. 가능한 값은 다음과 같습니다None.Cascade 기본값은 None입니다.
- 특성
예제
다음 예제에서는 개체를 ForeignKeyConstraint만들고, 해당 AcceptRejectRule개체를 설정하고, 제약 DataTable 조건을 개체에 ConstraintCollection추가합니다.
' The next line goes into the Declarations section of the module:
' SuppliersProducts is a class derived from DataSet.
Private suppliersProducts As SuppliersProducts
Private Sub CreateConstraint()
' Declare parent column and child column variables.
Dim parentColumn As DataColumn
Dim childColumn As DataColumn
Dim fkConstraint As ForeignKeyConstraint
' Set parent and child column variables.
parentColumn = suppliersProducts.Tables("Suppliers").Columns("SupplierID")
childColumn = suppliersProducts.Tables("Products").Columns("SupplieriD")
fkConstraint = New ForeignKeyConstraint( _
"SuppierFKConstraint", parentColumn, childColumn)
' Set null values when a value is deleted.
fkConstraint.DeleteRule = Rule.SetNull
fkConstraint.UpdateRule = Rule.Cascade
fkConstraint.AcceptRejectRule = AcceptRejectRule.Cascade
' Add the constraint, and set EnforceConstraints to true.
suppliersProducts.Tables("Suppliers").Constraints.Add(fkConstraint)
suppliersProducts.EnforceConstraints = True
End Sub
설명
메서드가 DataRow 호출될 때까지 AcceptChanges 변경 내용 또는 DataTable 최종 변경 내용이 없습니다. 이 시점에서 AcceptRejectRule 변경되거나 삭제된 모든 값에 대한 작업 과정을 결정합니다.