This documentation is archived and is not being maintained.

Edit Relation Dialog Box (XML Designer) 

Allows you to create and edit relationships between tables that are in XML Schemas.


In versions prior to Visual Studio 2005, the XML Designer is the designer for typed datasets and XML schema. The XML Designer can still be used to create and edit XML schema files. However, in the current version, the designer for creating and editing typed datasets is the Dataset Designer. For more information, see Dataset Designer.

This page assumes you are working with the XML Designer. To open a typed dataset file with the XML Designer, right-click the file in Solution Explorer, point to Open With, and then click XML Schema Editor.

Relationships in schemas are defined with a DataRelation object. Before a relationship can be created, there must be a column in the parent table that has a defined key node that can link to the child table. Relationships can then be added by dragging a Relation item from the XML Schema tab of the Toolbox onto the table. For more information, see Creating DataRelation Objects with the XML Designer.

DataRelation objects appear as lines on the design surface connecting the parent and child tables to a KeyRef object. Key and KeyRef statements are also added to the XML source code when you add a Relation item from the Toolbox to the designer.


Specifies a name for this relationship. For example, if you are relating a Customers table to an Orders table, you could name the relation "CustomersOrders."

Parent Element

Represents the parent table to which the relationship is being established.

Child Element

Represents the child table to which the relationship is being established.


Displays the keys defined in the table selected in the Parent Element drop-down list.

New button

Opens the Edit Key dialog box where new keys can be defined.

Parent Key Fields

Displays the key columns based on the selection in the Key drop-down list.

Foreign Key Fields

Displays elements that are members of the table selected in the Child Element box.

Create foreign key constraint only

When selected, allows you to enforce constraints only. Creating a 'constraint only' relation results in a slightly more efficient dataset with fewer methods in it. However you will not be able to access related records.

Update rule

Can be set to Default, None, Cascade, SetNull, or SetDefault.

Delete rule

Can be set to Default, None, Cascade, SetNull, or SetDefault.

Accept/Reject rule

Can be set to Default, None, or Cascade.

See Also