Typed DataSet - Child Objects?

  • Thread starter Thread starter Eric Barr
  • Start date Start date
E

Eric Barr

I've been looking at typed datasets and they seem like a great technology
for quite a few situations. I've been playing around with a simple test.
But, i'm not getting the behavior i would expect in regards to
herarchy/nesting of objects. In the XML schema designner I setup:

Parent (parent_ID, parent_name)
Child(parent_ID, child_ID, child_name)
GrandChild(child_Id, grandchild_id, grandchild_name)

When I go to consume the typed datset in my Code My typed dataset doesn't
seem to have child objects exposed.

I do get .... myHerarchy.Parent(0).Parent_name
I don't get... myHierarchy.Parent(0).Child(0).child_name


Is there something i'm missing? Should I expect typed datasets to expose
themselves like that ?


Regards,
-eric
 
Hi Eric,

You might consider something like:
myHierarchy.Parent(0).GetChildRows()(0).child_name
 
Miha,

Thanks for the info. I have tried that syntax.something like that.

So then is it safe to say.... if i want access to my typed dataset
something like :
myHierarchy.Parent(0).Child(0).child_name
That i should inherit from my typed dataset and expose the hierarcy
manually?


Regards,
-eric
 
One more question ...

In the XML schema designer I've noticed that you can do two things ...
1) Create a Relation between tables
2) Embed one table within another (nested complex type)

If I can't say Parent(0).Child(0), then whats the point of embedding the
type?
Whats the difference between the two?

Regards,
-eric
 
Back
Top