I try to fill the combobox data from the database, but for some reason it does not work. What could be the problem?

public void FillCmbStage() { string queryString = "SELECT * FROM organizer.stages"; using (SqlConnection connection = new SqlConnection("datasource=localhost;port = 3306;username=root;password=1234;")) { SqlCommand command = new SqlCommand(queryString, connection); connection.Open(); command.CommandTimeout = 0; SqlDataReader reader = command.ExecuteReader(); comboBox3.Items.Clear(); while (reader.Read()) { comboBox3.Items.Add(reader[0].ToString()); } reader.Close(); } } 
  • Comments are not intended for extended discussion; conversation moved to chat . - PashaPash

0