Hi friend, can you tell me how to use pg_dump to backup and restore pgsql database using C#.
Thanks and sorry about my english
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mirko Meier80 reputationPosted Mar 19, 2009, 10:38 AM EDT
masaddy wahyu6 reputationPosted Mar 19, 2009, 4:11 PM EDT
string strshp, pathshp; private void button1_Click(object sender, EventArgs e) { try { string user = txtExistDBName.Text; string user1 = textBox1.Text; // string Creten = "/c pg_dump -h 127.0.0.1 -U postgres -d" + " " + user + " " + "> gdm"; string Creten = "/c pg_dump -h 127.0.0.1 -U postgres -d" + " " + user + " " + "> " + " " + user1 + " " + ""; ProcessStartInfo Pinfo = new ProcessStartInfo("cmd.exe", Creten); Pinfo.RedirectStandardError = false; Pinfo.UseShellExecute = false; string Output = string.Empty; Process p = new Process(); p.StartInfo = Pinfo; p.StartInfo.CreateNoWindow = false; p.Start(); while (!p.HasExited) System.Threading.Thread.Sleep(1000); p.WaitForExit(); p.Close(); } I've tried open cmd.exe and write "creten" but dont work, whats wrong or can you send me your code that work. ThanksVijaya KadiyalaRank #1,085 · 1.8K reputationPosted Mar 21, 2009, 8:53 AM EDT
Hi
Check out the below link
http://pgfoundry.org/forum/forum.php?thread_id=1953&forum_id=519
Thanks -- Vijaya Kadiyala
http://dotnetvj.blogspot.com