Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to set up a DataRelation with Orphans ?

Posted on 2004-09-27
3
Medium Priority
?
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 1500 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 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