Click here to Skip to main content
15,937,127 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I’ve two comboboxes which contains two different informations and a datagridview (dgv) to display the records

1. cbTable: select table_name from information_schema.tables (multiple tables)
2. cbAttribute: manually enterd some column names from the selected cbTable
If cbTable is selected, the records should be displayed in dgv and
If cbAttribute is selected, it should link up with the selected cbTable and the display the records associated with it.
cbTable [tbl1, tbl2, tbl2 …]
ProjectNr  Location  FKZ  ABamount1  ABamount2	CFamount   …..
A.1234      South     Li    4000      1000        4080     ….
A.4567      North     La    5000      2200        1500     ….
B.5678      Southeast Li    8000      3000        3100     ….
C.9012      Central   Lu    6000      5000        250      ….
D.5672      East      La    2500      1000        8000     ….

cbAtrribute  [ProjektNr, Location, FKZ]. Ps: the column name are exact the same for all the table only the amounts differs.

So if I select tbl2 from cbTAble and ProjectNr, I expert something like this:
ProjectNr        ABamount1       ABamount2      CFamount        ABamount_Delta
A.1234            4000            1000            4080             3000
A.4567            5000            2200            1500             2800
B.5678            8000            3000            3100             5000
….                 ….              ….              ….               ….

OR if tbl2 and FKZ are selected:
FKZ            ABamount1        ABamount2       CFamount       ABamount_Delta
Li             12000            4000          4080          8000
La             7500             3200           1500           4300				
Lu             6000              5000            200             5000
….	….	….	….	….

Can you experts please help me out with suggestions or the c# code (winforms)?
Updated 22-Jan-15 20:32pm
BillWoodruff 22-Jan-15 7:54am    
If the user selects a Table in the first ComboBox, but has not yet selected any Item in the second ComboBox: do you want to display something in the DataGridView ?
mikybrain1 22-Jan-15 7:58am    
yes please. The tables selected should be shown

mikybrain1 22-Jan-15 12:02pm    
Hiwould u be kind and help please?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900