i have refer this mysql backup example
MySqlBackup.NET - MySQL Backup Solution for C#, VB.NET, ASP.NET[
^]
when i will take backup of mysql database it will show the following exception
System.argumentOutOffRange exception : Year,Month & day parameters describe an unrepresentable DateTime
at system.Datetime.DatetiTicks(Int32 year,Int32 Month,Int32 day)
at system.Datetime...ctor(int32 year,Int32 Month,Int32 day,int32 hour,int32 minute ,int32 second,int32 milllisecond,datetimekind kind)
at mysql.data.types.mysqlDatetime.GetDatetime();
at mysql.data.mysqlclient.mysqldatareader.getValue(int32 i)
at mysql.data.mysqlclient.mysqldatareader.get_item(int32 i)
at mysql.data.mysqlclient.mysqldatareader.getsqlvaluestring(mysqldatareader rdr)
at mysql.data.mysqlclient.mysqlbackup.ExportStart()
at mysql.data.mysqlclient.mysqlbackup.ExportExecute()
plz suggest any solution on this exception.>
MySqlBackup mb;
SaveFileDialog sf = new SaveFileDialog();
sf.FileName = "test " + DateTime.Now.ToString("yyyyMMdd HHmmss") + ".sql";
if (sf.ShowDialog() != System.Windows.Forms.DialogResult.OK)
{
return;
}
ProgressBar1.Value = 0;
timerRead.Start();
mb.Connection = new MySqlConnection(txtConstr.Text);
mb.ExportInfo.FileName = sf.FileName;
mb.ExportInfo.AsynchronousMode = true;
mb.ExportInfo.CalculateTotalRowsFromDatabase = true;
mb.ExportInfo.ExportTableStructure = true;
mb.ExportInfo.ExportRows = true;
mb.Export();
you can refer the
mysqlbackupnet/MySqlBackup.NET/MySqlBackup.cs
file for export() function
Thanks