reflexive relation in dataset

T

Thorsten Kallweit

Hi all,

I've got the following problem:

I need to describe a tree structure, the table in the dataset consists
of the columns structID, parentStructID, description with structID as
primary key.
the parentStructID of a root treenode is DBNull.
I define a reflexive 1:n relationship from treestructID to
parentTreeStructID.
loading the the database table into my dataset produces an error,
because the DBNull-value of my root tree node violates my DataSet
relation (but not the relation defined in my database, anyway).
common solution is: setting the nested-property of the DataRelation in
my DataSet to true. that works fine, so far so good.
here's the heart of the problem:
setting the nested property to true in VS2003 dataset desginer lets the
code generator forget my relation. that means if I instanciate my
dataset the relation collection remains empty.
if I set the nested property to default or false the relation will be
generated and I have access from code.
accessing and setting the nested property of my DataRelation to true
produces the result I need and everything works fine.
so what's wrong? the designer's handling of relationships or my
understanding of the designer? or do I miss to set a further property?

tia,
Thorsten Kallweit
 

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