The DataRelation Class

The DataRelation Class

You use an object of the DataRelation class to represent a relationship between two DataTable objects. You use a DataRelation object to model parent-child relationships between two database tables. By default, when you create a DataRelation, a UniqueConstraint and ForeignKeyConstraint are automatically added to your parent and child DataTable objects. Table 12.3 shows the DataRelation properties.

Table 12.3: DataRelation PROPERTIES

PROPERTY

TYPE

DESCRIPTION

ChildColumns

DataColumn[]

Gets the array of child DataColumn objects.

ChildKeyConstraint

ForeignKeyConstraint

Gets the ForeignKeyConstraint object for the DataRelation.

ChildTable

DataTable

Gets the child DataTable object.

DataSet

DataSet

Gets the DataSet to which the DataRelation belongs.

ExtendedProperties

PropertyCollection

Gets the PropertyCollection object that you can use to store strings of additional information.

Nested

bool

Gets or sets a bool value that indicates whether the DataRelation objects are nested. This is useful when defining hierarchical relationships in XML. The default is false.

ParentColumns

DataColumn[]

Gets the array of parent DataColumn objects.

ParentKeyConstraint

UniqueConstraint

Gets the UniqueConstraint object that ensures that DataColumn values in the parent DataTable are unique.

ParentTable

DataTable

Gets the parent DataTable object.

RelationName

string

Gets the name of the DataRelation object.




Mastering C# Database Programming
Mastering the SAP Business Information Warehouse: Leveraging the Business Intelligence Capabilities of SAP NetWeaver
ISBN: 0764596373
EAN: 2147483647
Year: 2003
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net