title: Export MYSQL Database to Excel in C# Windows Form Application
body: <p>I am using c# windows forms application where I am using MySQL DB, my requirement is to export complete table data in Excel format. Please tell me how it is possible.
  I am using following code to save my data in MYSQL DB</p>
  
  <pre><code>    private void insert_data()
      {
          string MyConnection2= "datasource=localhost;port=3306;username=abc;password=xyz";
  
          string Query = "";
          reset_data();
          Query = "INSERT INTO test_data.display_only(Article_ID ,Article_Name ,Manufacturer,Article_Quantity) SELECT Article_ID,Article_Name ,Manufacturer,Article_Quantity FROM _data.entered_items";
          MySqlConnection MyConn2 = new MySqlConnection(MyConnection2); 
          MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
          MySqlDataReader MyReader2;
          MyConn2.Open();
          MyReader2 = MyCommand2.ExecuteReader();     
          MessageBox.Show("Data Updated");
          while (MyReader2.Read())
         {
         }
          MyConn2.Close();
      }
  </code></pre>