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

Datagrid Parent/Child Relationship

I'm trying to comprehend the database features in VB and after tons of
reading I'm not sure how do relationships. I want to display a parent
column and the respective child columns on one line of a datagrid. For
example, Employee table and Employee Details table I'd like to display the
employee name and their details on one line of a datagrid, without having to
have the "hyperlink" to the employee details like I'd seen. Can anyone give
me a website that may have an example of something like this. I've search
around but can't find anything. Thanks
Nov 21 '05 #1
3 5850
Hi B-Dog,
The rease for relationships is to model the real life structure of the
system you want to manage or analyse.

With your example, the reason for having Employee Details in a separate
table to Employees is only valid if you want to store multiple sets of
Employee Details for each Employee. If not then you should have only one
Table. If you do then you can not represent the data on one line, if there
is more than one detail record. You can create a recordset that includes the
Employee fields and the Employee Detail fields:

"Select Employee.Field1, Employee.Field2, EmployeeDetails.Field1,
EmployeeDetails.Field2, etc....
FROM Employee LEFT JOIN EmployeeDetails ON Employee.PrimaryKeyField =
EmployeeDetails.ForiegnKeyField"

Where Field1 etc are Field Names and PrimaryKeyField is the name of the
Employee field that is the Primary Key and ForiegnKeyField is the name of
the EmployeeDetails field that is the Foriegn Key.
"B-Dog" <bd***@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I'm trying to comprehend the database features in VB and after tons of
reading I'm not sure how do relationships. I want to display a parent
column and the respective child columns on one line of a datagrid. For
example, Employee table and Employee Details table I'd like to display the
employee name and their details on one line of a datagrid, without having to have the "hyperlink" to the employee details like I'd seen. Can anyone give me a website that may have an example of something like this. I've search
around but can't find anything. Thanks

Nov 21 '05 #2
B-Dog,

When you start reading here, it would become clear I assume.

http://msdn.microsoft.com/library/de...ClassTopic.asp

I hope this helps?

Cor

I'm trying to comprehend the database features in VB and after tons of
reading I'm not sure how do relationships. I want to display a parent
column and the respective child columns on one line of a datagrid. For
example, Employee table and Employee Details table I'd like to display the
employee name and their details on one line of a datagrid, without having to have the "hyperlink" to the employee details like I'd seen. Can anyone give me a website that may have an example of something like this. I've search
around but can't find anything. Thanks

Nov 21 '05 #3
Oh I understand relationships, I do a lot of database work but I can't
figure out how to implement them in VB. They work but not easily like in
access. I'm just a little confused on the implementation in VB.
"Doug Bell" <dug@bigpond> wrote in message
news:Ot*************@TK2MSFTNGP11.phx.gbl...
Hi B-Dog,
The rease for relationships is to model the real life structure of the
system you want to manage or analyse.

With your example, the reason for having Employee Details in a separate
table to Employees is only valid if you want to store multiple sets of
Employee Details for each Employee. If not then you should have only one
Table. If you do then you can not represent the data on one line, if there
is more than one detail record. You can create a recordset that includes the Employee fields and the Employee Detail fields:

"Select Employee.Field1, Employee.Field2, EmployeeDetails.Field1,
EmployeeDetails.Field2, etc....
FROM Employee LEFT JOIN EmployeeDetails ON Employee.PrimaryKeyField =
EmployeeDetails.ForiegnKeyField"

Where Field1 etc are Field Names and PrimaryKeyField is the name of the
Employee field that is the Primary Key and ForiegnKeyField is the name of
the EmployeeDetails field that is the Foriegn Key.
"B-Dog" <bd***@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I'm trying to comprehend the database features in VB and after tons of
reading I'm not sure how do relationships. I want to display a parent
column and the respective child columns on one line of a datagrid. For
example, Employee table and Employee Details table I'd like to display the employee name and their details on one line of a datagrid, without having
to
have the "hyperlink" to the employee details like I'd seen. Can anyone

give
me a website that may have an example of something like this. I've

search around but can't find anything. Thanks


Nov 21 '05 #4

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

Similar topics

1
by: TusharP | last post by:
Hi Friends, My requirement are as follow..... 1) First DataGrid display all row of one table, with this one additional column having +/- control like tree. 2) When user click on +/- control ...
4
by: hennovanrensburg | last post by:
Hi all, I've noted a couple of posts regarding the speed of a datagrid in a ..net win app. My datagrid consists of 37 rows and 12 cols, and is unacceptably slow. How can this be? Should I...
7
by: Luis Esteban Valencia | last post by:
I have this i need to show the datagrid with columns of 2 datatables Dim myadap As New SqlDataAdapter myconn.Open() myadap.TableMappings().Add("Table", "vistaUsuarios")
6
by: Beren | last post by:
Hi all I'm almost braindead on this one, but how can I create a master/detail datagrid in this format : CatA subcatA1 subcatA2 subcatA3
1
by: DotNetJunkies User | last post by:
Hi, I was wondering if it is possible to load datagrid into datalist programatically using ITemplate interface with the following structure and place intp placeholder control. PlaceHolder -...
1
by: Peter Rilling | last post by:
I have an interesting problem with a datagrid. It is the standard chicken-and-the-egg problem. I have this page with two datagrids. It essentially defines a parent-child relationship. The...
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...
0
by: Digimode | last post by:
When using a non CaseSensitive DataSet which has 2 tables, a parent and a child with a one to one relationship (using col1 from both tables), as a datasource for an DataGrid, the grid does not show...
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...
5
by: BMeyer | last post by:
I have been losing my mind trying to parse an XML document (with nested child elements, not all of which appear in each parent node) into a DataGrid object. What I want to do is "flatten" the XML...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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

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.