backup mysql database using c#
-
sir i am devloping a project mysql query browser .....so i will need you in future ....i hope you will be for my help .....if you have facebook account plz tell me i want to conncet wid you...thanx in advance
A few things. 1. Unless somebody is really stupid and wants to attract a lot of spam, they tend not to give personal information out on the forums, especially to someone they don't know. 2. We are more than happy to help somebody with problems, but nobody on this forum has the time to start offering one to one help. 3. You'll find that we are much more willing to help people if they don't use text speak. It's deeply irritating to those of us who enjoy the full use of the keyboard.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
-
A few things. 1. Unless somebody is really stupid and wants to attract a lot of spam, they tend not to give personal information out on the forums, especially to someone they don't know. 2. We are more than happy to help somebody with problems, but nobody on this forum has the time to start offering one to one help. 3. You'll find that we are much more willing to help people if they don't use text speak. It's deeply irritating to those of us who enjoy the full use of the keyboard.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
-
-
i m providing code which i am running and getting exception plz help in this regard thanx .... :) public void Backup() { // Process.Start("IExplore.exe"); try { DateTime Time = DateTime.Now; int year = Time.Year; int month = Time.Month; int day = Time.Day; int hour = Time.Hour; int minute = Time.Minute; int second = Time.Second; int millisecond = Time.Millisecond; //Save file to C:\ with the current date as a filename string path; path = "C:\\MySqlBackup" + year + "-" + month + "-" + day + "-" + hour + "-" + minute + "-" + second + "-" + millisecond + ".sql"; StreamWriter file = new StreamWriter(path); ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = "mysqldump"; psi.RedirectStandardInput = false; psi.RedirectStandardOutput = true; psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}", "root","123456","localhost","userdb"); psi.UseShellExecute = false; Process process = Process.Start(psi); ///here is exception coming string output; output = process.StandardOutput.ReadToEnd(); file.WriteLine(output); process.WaitForExit(); file.Close(); process.Close(); } catch (IOException ex) { MessageBox.Show("Error , unable to backup!"); } } but when i run this code it is providing me runtime eroor exception ........".The system cannot find the file specified " at the line Process process = Process.Start(psi);
No idea, but this:
DateTime Time = DateTime.Now;
int year = Time.Year;
int month = Time.Month;
int day = Time.Day;
int hour = Time.Hour;
int minute = Time.Minute;
int second = Time.Second;
int millisecond = Time.Millisecond;//Save file to C:\ with the current date as a filename
string path;
path = "C:\\MySqlBackup" + year + "-" + month + "-" + day +
"-" + hour + "-" + minute + "-" + second + "-" + millisecond + ".sql";can be reduced to:
string path = System.String.Format ( @"C:\MySqlBackup{0:yyyy-MM-dd-HH-mm-ss-fff}.sql" , System.DateTime.Now ) ;
-
Glad to help
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
-
-
sir i want to provide path through " open file dialog box " ...how can i get the path where i want to save my backup file using this dialog box ...plz help thanx in advance .
Use a FolderBrowserDialog[^].
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
-
Use a FolderBrowserDialog[^].
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman