I'm trying to fill a ComboBox with a list. A list that I would previously fill with data from my database using the "SELECT code FROM country;" as a query.
string MyConString =
"SERVER=localhost;" +
"DATABASE=world;" +
"username=root;" +
"PASSWORD=1111;";
string sql = "SELECT code FROM country;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand cmdSel = new MySqlCommand(sql, connection);
DataTable dt = new DataTable();
MySqlDataAdapter da = new MySqlDataAdapter(cmdSel);
da.Fill(dt);
List<string> data = new List<string>();
How to fill data? I've tried a lot of stuff, it just does not work atm.