Losing strong typing when using DataRow.GetChildRows()

  • Thread starter Thread starter Jan Bannister
  • Start date Start date
J

Jan Bannister

This is just a general query about Data Binding.

I've got a Custom (VS 2003 generated) DataSet with a
number of strongly typed Custom DataTables within. I was
trying out using DataRelations to save me doing looping
compares in my code but I found that (obviouse in
retrospect) DataRow.GetChildRows() returns DataRow[]
which means i lose the strong typing of my rows (which i
*really* dont want to do).
Anyone come across this? Anyone any ideas about working
around it? Any future plans for the VS 2003 auto-
generated classes to provide helper functions, convertion
operators or custom dataset/row contructors that take
DataSet/Row as parameters.

Thanks in advance
Jan Bannister
 
Hi Jan,

What about masterRow.GetDetailRows() strongtyped method?
(Detail is detail table name)
 
Hey Miha,

Thanks for the heads up. I had a look for that function
and couldnt find it. I assume its put into the Custom
DataRow classes, is that right?
Do i need to have data relations in the .xsd file for VS
to auto generate the GetDetailRows() functions?

Thanks in advance
Jan


-----Original Message-----
Hi Jan,

What about masterRow.GetDetailRows() strongtyped method?
(Detail is detail table name)
--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Jan Bannister said:
This is just a general query about Data Binding.

I've got a Custom (VS 2003 generated) DataSet with a
number of strongly typed Custom DataTables within. I was
trying out using DataRelations to save me doing looping
compares in my code but I found that (obviouse in
retrospect) DataRow.GetChildRows() returns DataRow[]
which means i lose the strong typing of my rows (which i
*really* dont want to do).
Anyone come across this? Anyone any ideas about working
around it? Any future plans for the VS 2003 auto-
generated classes to provide helper functions, convertion
operators or custom dataset/row contructors that take
DataSet/Row as parameters.

Thanks in advance
Jan Bannister


.
 
Hi Jan,

Jan Bannister said:
Hey Miha,

Thanks for the heads up. I had a look for that function
and couldnt find it. I assume its put into the Custom
DataRow classes, is that right?
Right.

Do i need to have data relations in the .xsd file for VS
to auto generate the GetDetailRows() functions?

Yup. Based on relations in xsd it generates appropriate methods in dataset.
 
Back
Top