473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2050
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hazz | last post by:
I have 5 tables in SQL Server. Each with the following design and a sample chain of the relationships from the root (WRL - World) UUS is the 'Code' of the first table and it is the 'Parent' value...
4
by: Danny Tuppeny | last post by:
Hi all, I've been trying to write some classes, so when I have a parent-child relationship, such as with Folders in my application, I don't have to remember to add a parent reference, as well as...
2
by: Gerry | last post by:
I have an MDI form and a child form to go with it. The child form is called frmChild. There is also a button on the MDI form and when pressed invokes the following code ...
0
by: Ambica Jain | last post by:
I have a data grid called Files, which has some columns like FileName, Col1, Col2, ... , Col8. Then i have a combobox which allows user to select from Col1 to Col8 and based on this selection, i...
0
by: Innova | last post by:
Hi, We are working on a gridview inside the gridview (parent-child) scenario. The data of child grid will depend on the data of parent. Objectives: 1.Add new row in parent grid after each row...
2
by: Catch_22 | last post by:
Hi, I have a stored procedure that has to extract the child records for particular parent records. The issue is that in some cases I do not want to extract all the child records only a...
12
by: Phil | last post by:
I can check for MdiChildren.Length=0, but which event handler should I put this in to detect when a child window is closed? TIA Phil.
3
by: Chad Scharf | last post by:
Ok, as silly as it may sound, I have a situation where I am creating a CompositeControl in ASP.NET 2.0, C#. I have the following code in the CreateChildControls() method that build the control's...
20
omerbutt
by: omerbutt | last post by:
hi there i am making an application in which i have to populate columns that consist of some textfields and some input boxes the problem is at the mozilla's end, it creates a new node and appends the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.