A DataSet can contain either related or unrelated data. A DataSet can either have two unrelated or related tables. A DataSet can be thought of as a document of Data. In fact, an XML data document is like this, except it is based on a hierarchical paradigm. Because data is often stored in relational databases, the DataSet can handle both hierarchical relationships and foreign key relationships.
Relationships can also have different types of enforcement.
By default, deletions and updates are cascaded. A DataSet contains a Relations collection. The example below presumes two DataTable objects exist in the DataSet. The example adds a single DataRelation to the Relations collection of the DataSet object. The second and third arguments are the DataColumn objects that link the two tables.