469,601 Members | 2,105 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,601 developers. It's quick & easy.

Child Row Count

I have two tables pluged into a dataRelation Collection and I need to get the
count of rows in the child table. Anyone have ideas on how I can accomplish
this?
Nov 19 '05 #1
4 1872
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").Count

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have two tables pluged into a dataRelation Collection and I need to
get the count of rows in the child table. Anyone have ideas on how I
can accomplish this?


Nov 19 '05 #2
I need to present the count on RunTime in the DataGrid. It doesn't seem to
be working for me.

"Brock Allen" wrote:
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").Count

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have two tables pluged into a dataRelation Collection and I need to
get the count of rows in the child table. Anyone have ideas on how I
can accomplish this?


Nov 19 '05 #3
You'll need to post some code then. I'm not sure what the real problem is.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I need to present the count on RunTime in the DataGrid. It doesn't
seem to be working for me.

"Brock Allen" wrote:
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").Count

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have two tables pluged into a dataRelation Collection and I need
to get the count of rows in the child table. Anyone have ideas on
how I can accomplish this?


Nov 19 '05 #4
No worries Brock thank you for replying. I figured it out by adding a new
column in the DataTable that calculated the aggregate number of Child rows;
as follows:

// DataRelation Item.
// then I created the new column "NumberofImgs":

dsClub.Tables["EVNR"].Columns.Add("NumberofImgs",typeof(Double),"Count( Child(EVNR_IMG).EVNRID)");

I then bound the new column to the datagrid.

It seems clean and works fine.
"Brock Allen" wrote:
You'll need to post some code then. I'm not sure what the real problem is.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I need to present the count on RunTime in the DataGrid. It doesn't
seem to be working for me.

"Brock Allen" wrote:
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").Count

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have two tables pluged into a dataRelation Collection and I need
to get the count of rows in the child table. Anyone have ideas on
how I can accomplish this?


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Danny Tuppeny | last post: by
2 posts views Thread by Gerry | last post: by
reply views Thread by Ambica Jain | last post: by
reply views Thread by Innova | last post: by
omerbutt
20 posts views Thread by omerbutt | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.