Child Row Count

G

Guest

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?
 
G

Guest

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

Brock Allen said:
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").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?
 
B

Brock Allen

You'll need to post some code then. I'm not sure what the real problem is.




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

Brock Allen said:
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").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?
 
G

Guest

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 said:
You'll need to post some code then. I'm not sure what the real problem is.




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

Brock Allen said:
ds.Tables["Parent"].Rows[0].GetChildRows("MyRelationship").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?
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top