Guest User

Untitled

a guest
Jul 23rd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public void FillCmbStage()
  2. {
  3. string queryString = "SELECT * FROM organizer.stages";
  4. using (SqlConnection connection = new SqlConnection("datasource=localhost;port = 3306;username=root;password=1234;"))
  5. {
  6. SqlCommand command = new SqlCommand(queryString, connection);
  7. connection.Open();
  8. command.CommandTimeout = 0;
  9. SqlDataReader reader = command.ExecuteReader();
  10. comboBox3.Items.Clear();
  11. while (reader.Read())
  12. {
  13. comboBox3.Items.Add(reader[0].ToString());
  14. }
  15. reader.Close();
  16. }
  17. }
Add Comment
Please, Sign In to add comment