Solved

How to set up a DataRelation with Orphans ?

Posted on 2004-09-27
3
226 Views
Last Modified: 2012-05-05
I am trying to set up a hierarchical relationship between 2 tables in a datset. I have a table tblParent and a table tblChildren but not all Children have Parents.

When I try to display, I get the error: This constraint cannot be enabled as not all values have corresponding parent values

Is it possible to have 'orphans' and if so how to I set up this relationship so it will allow children with no parents ?

Can anyone help ?

0
Comment
Question by:Mamine
3 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
ID: 12159634
No, you can not do that with a datarelation object, what are you trying to achieve exactly, maybe there is another way to achieve the same.
0
 

Author Comment

by:Mamine
ID: 12159646
Shame - will re-jig the data to fit. Thanks for your help again Ronald :)
0
 

Expert Comment

by:scotthagie
ID: 12968917
Just turn the constraints off when creating the relation, the false at the end of the line:

MyDataSet.Relations.Add(TempRelationName, TempRelationColumnParent, TempRelationColumnChild, False)

Of course, you may have other problems later...
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question