开发者

Combo Box Task Data Binding Mode : using previous combo box to set the where condition

开发者 https://www.devze.com 2023-03-14 18:23 出处:网络
I have 2 ComboBoxes. First is Region, second is Customer. I want the second ComboBox to only display customers from the selected region.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消