private bool CheckDBConnection(string host, string user, string password, string schema)
 {
     try
     {
         DBControl db = new DBControl(host, user, password, schema);
         return(db.Open());
     }
     catch
     {
         return(false);
     }
 }
Exemple #2
0
        public DBControl(DBControl db)
        {
            this.serv  = db.serv;
            this.user  = db.user;
            this.passw = db.passw;
            this.db    = db.db;
            MySqlConnectionStringBuilder stringBuilder = new MySqlConnectionStringBuilder();

            stringBuilder.Server   = serv;
            stringBuilder.Password = passw;
            stringBuilder.UserID   = user;
            stringBuilder.Database = this.db;
            connection             = new MySqlConnection(stringBuilder.GetConnectionString(false));
        }
Exemple #3
0
 private void InitializeConnection(string dbHost, string dbUID, string dbPassw, string dbName)
 {
     dbConnection = new DBControl(dbHost, dbUID, dbPassw, dbName);
 }
Exemple #4
0
 private void InitializeConnection()
 {
     db = new DBControl(server, user, passw, database);
 }