开发者

Adding items to a combo box

开发者 https://www.devze.com 2023-03-16 12:39 出处:网络
I have a combo box that I want to bind with one column in my SQL database. This column is named \"Type\" and eac开发者_运维技巧h row has a type. There are 10 Types total. This table has a total of 144

I have a combo box that I want to bind with one column in my SQL database. This column is named "Type" and eac开发者_运维技巧h row has a type. There are 10 Types total. This table has a total of 144 rows.

Now, when I bind the combo box to this column, I get 144 items in the combo box. So, instead of just getting the 10 types, I am getting each type however many times it shows up in that column. Is there a way to fix this? I have thought about hard coding the items into the combo box, but this might mess up when the user adds an item with a new "Type". Any help is appreciated. thanks


SELECT DISTINCT Type FROM TABLE;

0

精彩评论

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

关注公众号