tags:

views:

466

answers:

2

Hi guys,

First I am running the below Command "mysqldump.exe --user=root --password=root accounts>accounts.sql" in the path C:>, to take backup, but it show error message "mysqldump is not a recognized command".

Then i changed the path in command prompt using the cd command to the location "C:\Program Files\MySQL\MySQL Server 5.0\bin>"

Now i am running the below command.

C:\Program Files\MySQL\MySQL Server 5.0\bin> mysqldump.exe --user=root --password=root accounts>accounts.sql

It is successfully working, but how can i achieve this work from VB.NET or C#.NET.

+2  A: 

Not quite sure what you are asking, but the following, runs the mysqldumb.exe with the parameters you specified. (C#)

Process.Start(@"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump.exe", "--user=root --password=root accounts>accounts.sql")
Arkain
A: 

You mean changing the current path? Here's the C# code to do it ...

Directory.SetCurrentDirectory(@"C:\Program Files\MySQL\MySQL Server 5.0\bin");
Aziz