Export (0) Print
Expand All

DataRelation Constructor (String, String, String, String[], String[], Boolean)

This constructor is provided for design time support in the Visual Studio environment.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)

[BrowsableAttribute(false)]
public DataRelation(
	string relationName,
	string parentTableName,
	string childTableName,
	string[] parentColumnNames,
	string[] childColumnNames,
	bool nested
)

Parameters

relationName
Type: System.String

The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the DataRelationCollection.

parentTableName
Type: System.String

The name of the DataTable that is the parent table of the relation.

childTableName
Type: System.String

The name of the DataTable that is the child table of the relation.

parentColumnNames
Type: System.String[]

An array of DataColumn object names in the parent DataTable of the relation.

childColumnNames
Type: System.String[]

An array of DataColumn object names in the child DataTable of the relation.

nested
Type: System.Boolean

A value that indicates whether relationships are nested.

Any DataRelation object created by using this constructor must be added to the collection with the AddRange method inside of a BeginInit and EndInit block. If this constructor is not called between BeginInit and EndInit a NullReferenceException will occur. In addition, the tables and columns with the specified names must exist at the time the constructor is called.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft