Solved

How to set up a DataRelation with Orphans ?

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now