Zoe Zoe - 1 year ago 91
MySQL Question

How to make my combo show data from two tables

I have a MDI C# code that reads and writes in and out of a sql DB. I have a "projects" form that has a "Companies" filed (combo) which should be read from the table companies. Now, for some other reason, I have another table which contains the name of some companies with different nature (and that is why they are in a separate table). Now I am wondering if it would be possible if I can have the company names from both of those tables in my project form. Do I need to changes the companies filed to a Listview? Do I have to change the SQL? I am pretty confused on this one. Can someone help? Please!

Answer Source
SELECT CompanyId, CompanyName FROM table1
SELECT CompanyId, CompanyName FROM table2

Refer: UNION & UNION ALL Diff.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download