asp.net.ph

DataRelationCollection.Add Method

System.Data Namespace   DataRelationCollection Class


Adds a DataRelation to the collection.

Overload List

1. Adds a DataRelation object to the collection.

2. Adds a DataRelation with the given parent and child columns to the collection.

3. Adds a DataRelation with the given arrays of parent and child columns to the collection.

4. Adds a DataRelation with the given name, and parent and child columns to the collection.

5. Adds a DataRelation with the given name, and arrays of parent and child columns to the collection.

6. Adds a DataRelation with the given name, parent and child columns, and whether to create a constraint.

7. Adds a DataRelation with the given name, arrays of parent and child columns, and whether to create a constraint.


Example

The following example adds a new DataRelation to the collection.

NOTE: This example shows how to use one of the overloaded versions of Add. For other examples that may be available, see the individual overload topics.

ds.Relations.Add ( "categoryId", 
   ds.Tables [ 0 ].Columns [ "CategoryID" ], 
   ds.Tables [ 1 ].Columns [ "CategoryID" ] );
  C# VB

See Also

DataRelationCollection Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note