Automatically Create Constraints in DataRelation

  • Thread starter Thread starter michael
  • Start date Start date
M

michael

The following constructor creates a new DataRelation.
With respect to the 4th parameter, I really can't see a
difference whether I put "True" in this position or use
the constructor that has only 3 parameters (no boolean).
What's the purpose of indicating whether or not you want
the constraints created?

Public Sub New(String, DataColumn, DataColumn, Boolean)
Initializes a new instance of the DataRelation class
using the specified name, matched arrays of parent and
child DataColumn objects, and value indicating whether to
create constraints.

Michael
 
Hi Michael,

Setting the 4th bool parameter createConstraint is to make sure that the
primary key of the parent table and the foreign key of the child table are
created and set the internal field createConstraint to true. The overload
Public Sub New(String, DataColumn, DataColumn) sets createConstraint to
true by default. So there's no difference between calling new
DataConstraint(String, DataColumn, DataColumn, true) and new
DataConstraint(String, DataColumn, DataColumn).

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| Content-Class: urn:content-classes:message
| From: "michael" <[email protected]>
| Sender: "michael" <[email protected]>
| Subject: Automatically Create Constraints in DataRelation
| Date: Wed, 15 Oct 2003 12:51:18 -0700
| Lines: 14
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcOTVbL1MkILrpC6TQWkLAHeVXLIrg==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63715
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| The following constructor creates a new DataRelation.
| With respect to the 4th parameter, I really can't see a
| difference whether I put "True" in this position or use
| the constructor that has only 3 parameters (no boolean).
| What's the purpose of indicating whether or not you want
| the constraints created?
|
| Public Sub New(String, DataColumn, DataColumn, Boolean)
| Initializes a new instance of the DataRelation class
| using the specified name, matched arrays of parent and
| child DataColumn objects, and value indicating whether to
| create constraints.
|
| Michael
|
 
Back
Top