Adding items to a combo box
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;
精彩评论