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)

'Declaration
<BrowsableAttribute(False)> _
Public Sub New ( _
	relationName As String, _
	parentTableName As String, _
	childTableName As String, _
	parentColumnNames As String(), _
	childColumnNames As String(), _
	nested As Boolean _
)

Parameters

relationName
Type: System.String

The name of the relation. If Nothing 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft