table1 table2 option1 displaysthis1 option2 displaysthis2 option3 displaysthis3
void Fillcombo() { string newcontact = "datasource=localhost;port=3306;username=root;password=password"; string Query = "select * from database.clients ;"; MySqlConnection addcon = new MySqlConnection(newcontact); MySqlCommand cmdDataBase = new MySqlCommand(Query, addcon); MySqlDataReader myReader; try { addcon.Open(); myReader = cmdDataBase.ExecuteReader(); while (myReader.Read()) { string sName = myReader.GetString("company"); comboBox1.Items.Add(sName); } } catch (Exception ex) { MessageBox.Show(ex.Message); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)