Guest User

Untitled

a guest
Mar 15th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. MySqlConnection con = new MySqlConnection("datasource=localhost;port=3306;database=meal;username=root;password=july241998");
  2. string query1 = $"SELECT title from recipe where budget = listBox.SelectedItem";
  3.  
  4.  
  5.  
  6. MySqlCommand cmd1 = new MySqlCommand(query1, con);
  7.  
  8. con.Open();
  9. MySqlDataReader dr1 = cmd1.ExecuteReader();
  10. while (dr1.Read())
  11. {
  12. richtextBox.Append = dr1.GetString("budget");
  13. }
  14. con.Close();
Add Comment
Please, Sign In to add comment