System.Data.DataRelation.SetChildKeyConstraint C# (CSharp) Method

SetChildKeyConstraint() private method

private SetChildKeyConstraint ( ForeignKeyConstraint value ) : void
value ForeignKeyConstraint
return void
        internal void SetChildKeyConstraint(ForeignKeyConstraint value)
        {
            Debug.Assert(_childKeyConstraint == null || value == null, "ChildKeyConstraint should not have been set already.");
            _childKeyConstraint = value;
        }

Usage Example

Ejemplo n.º 1
0
            protected override void RemoveCore(DataRelation relation)
            {
                base.RemoveCore(relation);

                _dataSet.OnRemoveRelationHack(relation);

                relation.SetDataSet(null);
                relation.ChildKey.GetSortIndex().RemoveRef();
                if (relation.Nested)
                {
                    relation.ChildTable.CacheNestedParent();
                }

                for (int i = 0; i < _relations.Count; i++)
                {
                    if (relation == _relations[i])
                    {
                        _relations.RemoveAt(i);
                        ((DataTableRelationCollection)(relation.ParentTable.ChildRelations)).Remove(relation); // Remove Cache from ParentTable -> ChildRelations
                        ((DataTableRelationCollection)(relation.ChildTable.ParentRelations)).Remove(relation); // Removing Cache from ChildTable -> ParentRelations
                        if (relation.Nested)
                        {
                            relation.ChildTable.CacheNestedParent();
                        }

                        UnregisterName(relation.RelationName);

                        relation.SetParentKeyConstraint(null);
                        relation.SetChildKeyConstraint(null);

                        return;
                    }
                }
                throw ExceptionBuilder.RelationDoesNotExist();
            }
All Usage Examples Of System.Data.DataRelation::SetChildKeyConstraint