Question Merging of dataset data

wstevens

Member
Joined
May 12, 2008
Messages
16
Location
South Africa PTA
Programming Experience
1-3
Hi all

I am trying to do the following, I have 2 table with one to many relationship via a index.

I would like to populate a datagridview with the records from the first table and add the records with the same Index from the second table but not as rows but as columns

so to sum it up

Table 1

PID | Name

0 | John


Table 2

BID | PID | TelephoneType | TelephoneNo

1 | 0 | Home | 000 000 0000
2 | 0 | Office | 111 111 1111


DataGridview

PID | Name | Home | Office

0 | John | 000 000 0000 | 111 111 1111


This is how I want my datagridview in my application to look like. Im using VS 2005 Pro Edition. Is this possible keeping into consideration that I need to be able to cascade updates from either records back to there individual tables.

Thank you for your help in advance
 
Youre going to have to write the pivot logic yourself because what youre trying to achieve here breaks the typical design goal of a relational database management system..

Consider that probably every other crm style app i've ever seen, in the world, works jsut fine with having X number of columns in one table, for the different types of phone number someone may have (land, cell, fax, pager, line 2 on all above, voip.. etc)
 
Bingo! And that's why it represents a break in RDBMS paradigm.. Youre carving a much harder path for yourself here than needs be, but such is the price of the ultimate flexibility youre attempting to offer. Good luck ;)
 
Back
Top