i have tried this method but it doesn't working anyone can correct it or share some tutorial for Backup/Restore PostgreSQL using VB.NET
and these methods are using to backup/restore
here commandType = pg_dump
and commandSentence = -i -h localhost -p 5432 -U postgres -F c -b -v -f C:\Documents and Settings\GDS\Desktop\backup\RStar.backup RStar
but returns nothing in the folder where i am trying to place the backup file
private void executeCommand(string commandType,string commandSentence )
{
try
{
System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
info.FileName = "C:\\Program Files\\PostgreSQL\\9.2\\bin\\" + commandType + ".exe ";
info.Arguments = commandSentence;
info.CreateNoWindow = true ;
info.UseShellExecute = false;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = info;
proc.Start();
proc.WaitForExit();
if (commandType == "pg_dump")
toolStripStatusLabel1.Text = "Backup successfuly created";
else if (commandType == "pg_restore")
toolStripStatusLabel1.Text = "Restore successfuly executed";
else if(commandType=="shp2pgsql")
toolStripStatusLabel1.Text = "Your selected shape file successfuly transfered to PostGIS";
else if (commandType == "pgsql2shp")
toolStripStatusLabel1.Text = "Your selected layer from PostGIS successfuly converted to shape file";
}
catch (Exception ex)
{
toolStripStatusLabel1.Text = ex.ToString();
}
}