I have 2 ComboBoxes. First is Region, second is Customer.
I want the second ComboBox
to only display customers from the selected region.
So the second ComboBox
should only have this:
select Customer_Name from Customer WHERE customer_region = selected_region
How to do this u开发者_如何学Gosing the GUI winform, ComboBox
task? Can I just modify the select
statement? How to do this?
You need to take the selected region and use it in the SQL query as a parameter. This will give you the customer names that correspond to the selected region. Then you just add the results to the Customer ComboBox. The following link should give you a good place to start.
http://social.msdn.microsoft.com/Forums/en-IE/csharplanguage/thread/f3539705-a1d0-4201-a8fe-32e5b0f82e93
精彩评论