Table data in combobox and dont display duplicate – help

 MySqlConnection mcon = new MySqlConnection("server=*********;database=**;user=**;password=****"); string s = "SELECT DISTINCT * from t1.data"; mcon.Open(); MySqlCommand mcd = new MySqlCommand(s, mcon); MySqlDataReader mdr = mcd.ExecuteReader(); while (mdr.Read()) { comboBox4.Items.Add(mdr.GetString("voznik")); comboBox6.Items.Add(mdr.GetString("regstvoz")); comboBox7.Items.Add(mdr.GetString("rprikolice")); comboBox9.Items.Add(mdr.GetString("stranka")); comboBox8.Items.Add(mdr.GetString("disponent")); } 

I have a problem that combobox display all data from table i need only those that are not duplicated.

Sorry for bad english.

by thecartko via /r/csharp

Leave a Reply