473,387 Members | 1,493 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,387 software developers and data experts.

getting parent and child tables from datagrid


Can someone show my example syntax that gets pointers to both the parent and
child tables of a datagrid on a form showing a child table? The datasource
is a dataview, the datamember is the relationship name (e.g. 'OrderDetail')

i.e.....(air code following)

dim dtParent as dataTable
dim dtChild as dataTable

dtParent = mygrid.....
dtChild = mygrid

thank you.
Nov 21 '05 #1
2 1147
Hi,

"astro" <as***@mnrr.com> wrote in message
news:yW********************@tornado.rdc-kc.rr.com...

Can someone show my example syntax that gets pointers to both the parent
and child tables of a datagrid on a form showing a child table? The
datasource is a dataview, the datamember is the relationship name (e.g.
'OrderDetail')

i.e.....(air code following)

dim dtParent as dataTable
dim dtChild as dataTable

If you know DataSource is a DataView, then you can do:
dtParent = DirectCast(mygrid.DataSource, DataView).Table

And if you know that DataMember is a relation, then you can do:
dtChild = dtParent.ChildRelations(mygrid.DataMember).ChildTa ble

I'm not sure why you would want to do this, you will end up with the same
tables you filled with the DataAdapters.

hth,
greetings

thank you.

Nov 21 '05 #2
thank you - that worked )

"Bart Mermuys" <bm*************@hotmail.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
Hi,

"astro" <as***@mnrr.com> wrote in message
news:yW********************@tornado.rdc-kc.rr.com...

Can someone show my example syntax that gets pointers to both the parent
and child tables of a datagrid on a form showing a child table? The
datasource is a dataview, the datamember is the relationship name (e.g.
'OrderDetail')

i.e.....(air code following)

dim dtParent as dataTable
dim dtChild as dataTable


If you know DataSource is a DataView, then you can do:
dtParent = DirectCast(mygrid.DataSource, DataView).Table

And if you know that DataMember is a relation, then you can do:
dtChild = dtParent.ChildRelations(mygrid.DataMember).ChildTa ble

I'm not sure why you would want to do this, you will end up with the same
tables you filled with the DataAdapters.

hth,
greetings

thank you.


Nov 21 '05 #3

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

Similar topics

0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
3
by: Darryn Ross | last post by:
Hi, How do i get my datagrid to display the contents of two related tables setup in my access database, so i can see the plus/minus sign to expand retract the Child details? Regards Darryn
4
by: What-a-Tool | last post by:
I am trying to write a program that will take all the members of a data base, add them to a tree, with all child relations as sub-nodes. I am having a problem getting the parent child relations...
4
by: Frank | last post by:
Hello, I have a dataset with 2 tables and a relation (parent - child). I linked that ds to a datagrid. Shows everything fine (very little coding for such functionality!). But.. in the child row I...
0
by: DraguVaso | last post by:
Hi, I have in my VB.NET-application a DataGrid with two DataTables in with a Parent-Child-relationship defined. When the users clicks on a call in the DataGrid, i want to know the MappingName...
2
by: mkidd | last post by:
Hi, I'm new at vb .net and I have an issue that must be a common one, but I haven't found an example of it yet. I want to create parent-child relationships for 3 tables...
0
by: Iain | last post by:
Hi All My apologies for posting this here but the Delphi newsgroup is very slow. Using Borland Developer Studio 2006 - creating a C# .net application. I have a datagrid (id = "Documents")...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
1
by: Sep410 | last post by:
Private Sub frmSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sql1 As String Dim sql2 As String Dim da1 As SqlDataAdapter ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.