473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Return datatable records that have a childrow that meets a search critieria

I have a datatable (I will call it 'main' datatable) with records that have
child rows. I need to select all the records from the main datatable where
the record/row has a childrow that meets a search criteria.

word to match="correctvalue"

row___
|---- childrow1(wrongvalue1)
|---- childrow2(wrongvalue2)
|---- childrow3(correctvalue) MATCH

If this occurs, I want to return the row.

My question is: Is there a neat way to do this, f.ex. using the select
method in the main datatable? Or am I basically stuck with iterating through
all the rows and childrows manually.

- Magnus
May 23 '06 #1
3 1263
you can fill first table with this statement

select * from maintable

and fill child table with this statement

select childTable.* from childTable, mainTable
WHERE ((childTable.Id = mainTable.ID) AND (YOUR CONDITION HERE))

hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 23 '06 #2

"Galcho[MCSD.NET]" <ga****@gmail.com> skrev i melding
news:11**********************@j33g2000cwa.googlegr oups.com...
you can fill first table with this statement

select * from maintable

and fill child table with this statement

select childTable.* from childTable, mainTable
WHERE ((childTable.Id = mainTable.ID) AND (YOUR CONDITION HERE))

hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com


I should have mentioned, but the only data I have accessible is in a ado.net
datatable, I do not have the luxury of executing SQL queries against a sql
database.

The data in the ado.net datatable is loaded from a xml file.

- Magnus
May 23 '06 #3
then you can use DataTable.DefaultView.Filter property to enter your
condition for child table

hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Top Gun | last post by:
I have a DataSet containing a Parent/Child relationship that has been populated by Sql Server. I have an expectation that certain child records should exist for each parent based upon column data....
9
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the...
4
by: Rich | last post by:
Hello, I need to store various values that I will need to look up later on. I have been using hashtables and arraylists. But I can only store 2 items per row in a hashtable - key, value, and...
2
by: themillerman | last post by:
Hi, I'm an access 2003 novice trying to improve the search ability of my club membership database. I am currently searching for the members surnames by simply running a query (Please enter surname...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.