Dump and Restore Progress
Posted: Mon 12 Dec 2011 16:22
I am able to to a Backup and monitor the progress, but can't seem to get the progress for the restore. Any advice here?
Thanks in advance.
Thanks in advance.
Discussion forums for open issues and questions concerning database tools, data access components and developer tools from Devart
https://forums.devart.com/
Code: Select all
MySqlDump dump = new MySqlDump(conn);
conn.Open();
Code: Select all
dump.Backup("D:\mydump.txt");
Code: Select all
FileInfo file = new FileInfo("D:\mydump.txt");
MySqlScript script = new MySqlScript();
script.Connection = conn;
script.ScriptText = file.OpenText().ReadToEnd();
script.Progress+= new Devart.Common.ScriptProgressEventHandler(onProgress);
IDataReader reader;
while (script.ExecuteNext(out reader))
{
reader.Close();
}
Code: Select all
static void onProgress(object sender, Devart.Common.ScriptProgressEventArgs e)
{
//percentage of the operation completion
Console.WriteLine((100*e.Offset)/((MySqlScript)sender).ScriptText.Length);
//Console.WriteLine(e.Text); //Executed script text
}