asp.net.ph

DataRelation Constructor

System.Data Namespace   DataRelation Class


Initializes a new instance of the DataRelation class.

Overload List

1. Initializes a new instance of the DataRelation class using the specified name, parent, and child columns.

2. Initializes a new instance of the DataRelation class using the specified name, parent and child columns, and a value indicating whether to create constraints.

3. Initializes a new instance of the DataRelation class using the specified name and matched arrays of parent and child columns.

4. Initializes a new instance of the DataRelation class using the specified name, matched arrays of parent and child columns, and a value indicating whether to create constraints.


Example

The following example initializes a new DataRelation and adds it to the DataRelationCollection of a DataSet.

NOTE: This example uses one of the overloaded versions of the DataRelation constructor. For other examples that may be available, see the individual overload topics.

DataRelation categoryId = new DataRelation ( "categoryId", 
   myDataSet.Tables [ "Categories" ].Columns [ "CategoryID" ],
   myDataSet.Tables [ "Products" ].Columns [ "CategoryID" ] );

   // add the relation to the DataSet.
   myDataSet.Relations.Add ( categoryId );
  C# VB

 Show me 

See Also

DataRelation Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph