Click here to Skip to main content
12,510,594 members (50,396 online)
Click here to Skip to main content

Tagged as

Stats

13K views
2.5K downloads
8 bookmarked
Posted

Backup/Restore PostgreSQL databases

, 5 Mar 2013 CPOL
Allow your applications the ability to backup and restore your PostgreSQL databases.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pgstore
{
    public class Config
    {
        public Config()
        {
            Parametres = new StoreParameters();
            Port = 5432;
            ServerName = "localhost";
            UserName = "postgres";
            Password = "";
        }

        public string ServerName { get; set; }
        public string DataBase { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public int Port { get; set; }

        public bool AllISOK(ref string message)
        {
            bool b = true;
            if (this.ServerName == "") { b = false; message = "missing server name"; }
            if (this.DataBase == "") { b = false; message = "Missing database"; }
            if (this.UserName == "") { b = false; message = "Missing username"; }
            return b;
        }
        public StoreParameters Parametres
        { get; set; }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Saddoud Anis
Software Developer (Senior) B&B
Tunisia Tunisia
Microsoft DOTNET developer
VOIP Technologies
ERP Petales

http://www.declaration.tn/

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160929.1 | Last Updated 5 Mar 2013
Article Copyright 2013 by Saddoud Anis
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid