Many-to-one Relationships in DATASETs

H

Hananiel

How do you enforce a many to one relationship in DataSets?
Can I have two different parents for the same child table in a dataset. The
columns for which the relationships exist are the same:

For ex:


TABLE1:

Columns: ID, THISTABLETYPE, DATA

TABLE2:

Columns: ID,THISTABLETYPE, DATA

CHILDTABLE3:

Columns: ID, TABLETYPE, TABLEID, DATA


When TableTYPE is table1, TABLEID should be assigned ID from TABLE1
and when TableTYPE is table2, TABLEID should be assigned ID from TABLE2

The goal is to be able to propogate IDs from parents to child, when the
dataset is saved.

The problem is, setting a relationship in the dataset between table1 and
childtable3 based on TABLETYPE AND ID, and a relationship between table2 and
childtable3 based on TABLETYPE AND ID, causes errors in enforcing
constraints when the data is read. (At least one relation is violated in
each case)

Thanks,

Hananiel
 
M

Miha Markic

Hi Hananiel,

I think that dataset will check both relations and that is why you are
getting an error.
I don't think you'll be able to make relations work in this mode.
However, you might combine both table1 and table2 into a single table..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top