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); } }
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)); }
private void InitializeConnection(string dbHost, string dbUID, string dbPassw, string dbName) { dbConnection = new DBControl(dbHost, dbUID, dbPassw, dbName); }
private void InitializeConnection() { db = new DBControl(server, user, passw, database); }