Preventing duplicate values being added to a dropdown menu
This thread will be reviewed shortly.
If you think this thread contain inappropriate content, please report to webmaster.
I'm trying to populate a dropdown menu with values from a sql database table however I can't work out how to stop duplicate values being added.
I have created a datareader object which pulls the info out of the database then I use this datareader to populate the dropdown as follows:
menuLanguages.DataSource = drLanguages
menuLanguages.DataTextField = "language_name"
menuLanguages.DataValueField = "language"
But this of course then lists all the records in the datareader. How do I skip any values that have already appeared in the list once?