Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

Relationships in Datasets 

A dataset can contain related tables like a relational database. The object that facilitates a relationship between data tables is a DataRelation object. The following topics provide information about ADO.NET DataRelation objects, how to create them, and how to use them to work with data in related tables.

NoteNote

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

In This Section

Introduction to DataRelation Objects

Provides an overview of how datasets allow you to specify relationships between tables and how you can take advantage of these relationships.

How to: Create DataRelations with the Dataset Designer

Explains how to use the Dataset Designer to add a DataRelation object to a dataset.

How to: Access Records in Related DataTables

Explains how to programmatically return related records in a typed dataset with tables in a one-to-many relationship.

How to: Display or Hide Relationship Names on the Dataset Designer

Explains how to toggle on and off the displaying of the relationship name on the Dataset Designer surface.

Walkthrough: Creating a Relationship between Data Tables

Provides step-by-step instructions for creating two data tables with the Dataset Designer and adding a relation between them.

Reference

DataRelation

Represents a parent/child relationship between two T:System.Data.DataTable objects.

GetChildRows

Gets the child rows of a T:System.Data.DataRow.

GetParentRow

Gets the parent rows of a T:System.Data.DataRow.

Rule

Indicates the action that occurs when a ForeignKeyConstraint is enforced.

Unique

Gets or sets a value indicating whether the values in each row of the column must be unique.

Constraint

Represents a constraint that can be enforced on one or more DataColumn objects.

Related Sections

Adding a Relationship between Tables

Describes how to create relations between tables in a DataSet.

Navigating a Relationship between Tables

Describes how to use the relations between tables in a DataSet to return the child or parent rows of a parent-child relationship.

Nested DataRelations

Discusses the importance of nested DataRelation objects when representing the contents of a DataSet as XML data, and describes how to create them.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.