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

SetParentKeyConstraint() private method

private SetParentKeyConstraint ( UniqueConstraint value ) : void
value UniqueConstraint
return void
        internal void SetParentKeyConstraint(UniqueConstraint value)
        {
            Debug.Assert(_parentKeyConstraint == null || value == null, "ParentKeyConstraint should not have been set already.");
            _parentKeyConstraint = 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::SetParentKeyConstraint