EDITED : Now i know what you want to do exactly
Here is a code to make it in a method
string binary = @"C:\MySQL\MySQL Server 5.0\bin\mysqldump.exe"
string arguments = @"-uroot -ppassword sample"
ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo(binary, arguments);
PSI.RedirectStandardInput = true;
PSI.RedirectStandardOutput = true;
PSI.RedirectStandardError = true;
PSI.UseShellExecute = false;
Process p = System.Diagnostics.Process.Start(PSI);
Encoding encoding = p.StandardOutput.CurrentEncoding;
System.IO.StreamWriter SW = new StreamWriter(@"c:\backup.sql", false, encoding);
p.WaitOnExit();
string output = p.StandardOutput.ReadToEnd()
SW.Write(output)
SW.Close();
Good luck!