public QueryExecutor() { this.connector = new MySqlConnector(); this.command = new MySqlCommand(); this.command.Connection = this.connector.Connection; try { this.connector.Connection.Open(); } catch (MySqlException ex) { switch (ex.Number) { case 0: MessageBox.Show("Cannot connect to server. Contact administrator"); break; case 1045: MessageBox.Show("Invalid username/password, please try again"); break; } } }