Given a dataset [ds] and combobox dropdown [cbClient], I need to populate the dropdown with the values from column0 of ds.Tables[0]
Problem is I want the values in the combobox [cbClient] to be unique...
Dataset ds looks like this (space in between each column):
client1 Assignment1 ACTIVE
client1 Assignment2 ACTIVE
client2 Assignment1 ACTIVE
As you can see there are two rows that have a value of Client1, if I populate my cbClient directly with the Dataset ds.Tables[0] then my Combobox [cbClient] will have Client1, Client1, Client2 - I only want UNIQUE names in the combobox, no repeating Client1 twice because it is in two rows.
The only thing I could think of is going through the dataset manually and checking to see if the item is already there, adding it only if it is not (using something like a foreach row loop and the .FindStringExact but that keeps giving me a lot of exception errors.
Any help/hints/comments would be greatly appreciated - I just want the list of words in my combobox [cbClient] to be unique and sorted alphabetically (if thats not asking to much ehhehe)
Problem is I want the values in the combobox [cbClient] to be unique...
Dataset ds looks like this (space in between each column):
client1 Assignment1 ACTIVE
client1 Assignment2 ACTIVE
client2 Assignment1 ACTIVE
As you can see there are two rows that have a value of Client1, if I populate my cbClient directly with the Dataset ds.Tables[0] then my Combobox [cbClient] will have Client1, Client1, Client2 - I only want UNIQUE names in the combobox, no repeating Client1 twice because it is in two rows.
The only thing I could think of is going through the dataset manually and checking to see if the item is already there, adding it only if it is not (using something like a foreach row loop and the .FindStringExact but that keeps giving me a lot of exception errors.
Any help/hints/comments would be greatly appreciated - I just want the list of words in my combobox [cbClient] to be unique and sorted alphabetically (if thats not asking to much ehhehe)