DataRelations in typed datasets, runtime/compile time binding

  • Thread starter Thread starter ggabe
  • Start date Start date
G

ggabe

Typed datasets seems to have a good compile time binding with the
table layout, i.e. all the table names and columns names are bound to
a C# class in compile time. But I found no compile time binding
equivalent for the data relations, however it could have been done.

A practical example:

MyTypedDS myDS;
//Defines two tables - parent and child, and has a relation between
them.

foreach (MyTypedDS.ParentRow parentRow in myDS.Parent.Rows){
foreach (MyTypedDS.ChildRow childRow in parentRow.GetChildRows(XXX)){
^^^

I can't pick anything from the dataset class for XXX, need to use
myDS.Relations["relationname"] that is a runtime binding - or maybe I
just missed something?


Thanks,
Gabe
 
Each Typed DataRow class that is from a Child DataTable
includes properties named <Parent Table Name>Row that
accesses it's parent DataRow.

Each Typed DataRow class that is from a Parent DataTable
includes methods named Get<Child Table Name>Rows() that
returns an array of child DataRows.

Not sure if this is what you are looking for out of the
DataRelations, but hope it helps.


Regards,

David
-----Original Message-----
Typed datasets seems to have a good compile time binding with the
table layout, i.e. all the table names and columns names are bound to
a C# class in compile time. But I found no compile time binding
equivalent for the data relations, however it could have been done.

A practical example:

MyTypedDS myDS;
//Defines two tables - parent and child, and has a relation between
them.

foreach (MyTypedDS.ParentRow parentRow in myDS.Parent.Rows){
foreach (MyTypedDS.ChildRow childRow in parentRow.GetChildRows(XXX)){^^^

I can't pick anything from the dataset class for XXX, need to use
myDS.Relations["relationname"] that is a runtime binding - or maybe I
just missed something?


Thanks,
Gabe
.
 
This is what I was looking for! Thanks!

But why these methods are not showing up in intellisense neither in
class view? It's definitely in the dataset class source code. Maybe a
bug in VS 2003 7.1.3088?

Gabe

David Archuleta said:
Each Typed DataRow class that is from a Child DataTable
includes properties named <Parent Table Name>Row that
accesses it's parent DataRow.

Each Typed DataRow class that is from a Parent DataTable
includes methods named Get<Child Table Name>Rows() that
returns an array of child DataRows.

Not sure if this is what you are looking for out of the
DataRelations, but hope it helps.


Regards,

David
-----Original Message-----
Typed datasets seems to have a good compile time binding with the
table layout, i.e. all the table names and columns names are bound to
a C# class in compile time. But I found no compile time binding
equivalent for the data relations, however it could have been done.

A practical example:

MyTypedDS myDS;
//Defines two tables - parent and child, and has a relation between
them.

foreach (MyTypedDS.ParentRow parentRow in myDS.Parent.Rows){
foreach (MyTypedDS.ChildRow childRow in parentRow.GetChildRows(XXX)){^^^

I can't pick anything from the dataset class for XXX, need to use
myDS.Relations["relationname"] that is a runtime binding - or maybe I
just missed something?


Thanks,
Gabe
.
 
Back
Top