Solved

How to set up a DataRelation with Orphans ?

Posted on 2004-09-27
3
228 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

685 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