title: How to save data to xampp phpmyadmin mysql database from windows form application c#
body: <p>How to save data  to xampp phpmyadmin mysql database from windows form application c# ? variables with data are country1,city1,temperature1.
  Database is weather and table is forecast</p>
  
  <pre><code>try
  {
  
      string MyConnection2 = "datasource=localhost;port=3307;username=db1;password=db12121";
      string Query = "insert into weather.forecast(country, city, temperature) values('" + country1 + "','" + city1 + "','" + temperature "');";
  
  
      MySqlConnection MyConn2 = new MySqlConnection(MyConnection2);
      MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
      MySqlDataReader MyReader2;
      MyConn2.Open();
      MyReader2 = MyCommand2.ExecuteReader();    
      MessageBox.Show("Save Data");
      while (MyReader2.Read())
      {
      }
      MyConn2.Close();
  }
  catch (Exception ex)
  {
      MessageBox.Show(ex.Message);
  }
  </code></pre>