Relation and ForeignKeyConstraint

  • Thread starter Thread starter Polo
  • Start date Start date
P

Polo

Hi All,

I start with ADO.NET and I have a question :

What is the difference between Relation and ForeignKeyConstraint ? Is a
Relation generates automaticly a foreignkeyconstraint ? When a foreignKey is
usefull <-> Relation

Polo
 
ForiegnKeyConstraint is defined by MSDN as
"Represents an action restriction enforced on a set of columns in a primary
key/foreign key relationship when a value or row is either deleted or
updated."

It's the action restriction. The DataRelation is the object which
essentially creates this restriction.

Does a DataRelation automatically create a ForeignKeyConstraint? Yes. When
you add a datarelation, a ChildKeyConstraint is added as well as a
ParentKeyConstraint.
http://msdn.microsoft.com/library/d...tml/frlrfsystemdatadatarelationclasstopic.asp

HTH,

Bill
 
Back
Top