473,725 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
+ 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="correctv alue"

row___
|---- childrow1(wrong value1)
|---- childrow2(wrong value2)
|---- childrow3(corre ctvalue) 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 1281
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.c om> skrev i melding
news:11******** **************@ j33g2000cwa.goo glegroups.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.Defau ltView.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
2254
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. If, for some reason, these child records don't exist I would like to add them. Here is a scenario, Billing installment detail are children of a billing header record, with the number of installs called out by the header. The children are being...
9
1710
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 system since all this data will be stored in memory. The performance is really affected with this. Since we don't really want to redesign everything based on this datatable, are there any companies that offer a product similar to the datatable...
4
6013
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 only 1 item in an arraylist. Or, I could create a class with various members and store that in a collection, or a structure, ... I was thinking, I could create a datatable and add data to the datatable. But when I need to retrieve data from...
2
1532
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 in the critieria field or the query) which then returns the records of everyone matching the surname entered. This is pretty rubbish as there is no error handling functionality and requires the user to scroll through the records if more than one...
0
8872
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9246
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9162
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9091
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8069
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6694
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4773
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2619
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2150
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.