Export (0) Print
Expand All

DataRelation Constructor (String, String, 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 parentTableNamespace,
	string childTableName,
	string childTableNamespace,
	string[] parentColumnNames,
	string[] childColumnNames,
	bool nested
)

Parameters

relationName
Type: System.String
The name of the DataRelation. 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.
parentTableNamespace
Type: System.String
The name of the parent table namespace.
childTableName
Type: System.String
The name of the DataTable that is the child table of the relation.
childTableNamespace
Type: System.String
The name of the child table namespace.
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 then be added to the collection with AddRange. Tables and columns with the specified names must exist at the time the method is called, or if BeginInit has been called before calling this constructor, the tables and columns with the specified names must exist at the time that EndInit is called.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2014 Microsoft