Link to home
Start Free TrialLog in
Avatar of Jassimi
JassimiFlag for Bahrain

asked on

combobox and duplicate items

hi..
I have a combobox that contains some items of one feild in database,,
some items are duplicate in that feild,
is there any method to remove the duplicate names in the combobox?
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Hello Jassimi,

Easiest to remove the duplicates in the retrieval process from the database.

Using something like "Select Distinct MyField From MyTable" to eliminate duplicates before binding to the dropdown.

Regards,

TimCottee
Avatar of Jassimi

ASKER

I don't want to remove it from the database..
I just want to remove it from the combobox
Jassimi,

That doesn't remove it from the table, simply selects only distinct values. It has no effect on what is stored there, just the values that are bound to the dropdown.

TimCottee
Avatar of Jassimi

ASKER

can you tell me how to that exactly,
because I connect this combobox through properties, I just chose the datasource and displaymember,

can I select the distinct values from properties,
tell me step by step
ASKER CERTIFIED SOLUTION
Avatar of Jassimi
Jassimi
Flag of Bahrain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial