This documentation is archived and is not being maintained.

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

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

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

public DataRelation (
	string relationName,
	string parentTableName,
	string childTableName,
	string[] parentColumnNames,
	string[] childColumnNames,
	bool nested
public DataRelation (
	String relationName, 
	String parentTableName, 
	String childTableName, 
	String[] parentColumnNames, 
	String[] childColumnNames, 
	boolean nested
public function DataRelation (
	relationName : String, 
	parentTableName : String, 
	childTableName : String, 
	parentColumnNames : String[], 
	childColumnNames : String[], 
	nested : boolean
Not applicable.



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


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


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


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


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


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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0