How to export database data into Excel file using C# Windows Forms application?
This is my code:
MySqlConnection con = new MySqlConnection(conne);
con.Open();
MySqlCommand com = new MySqlCommand ("SELECT * FROM aster",con);
MySqlDataAdapter data = new MySqlDataAdapter(com);
DataTable dat = new DataTable("aster");
data.Fill(dat);
dat.WriteXml("C:Downloads\\agent.xls");
MessageBox.Show("export data successfully");
The data exports successfully. But my problem is that again and again it saves in same file.
Please refer some link to help me.