Exemplo n.º 1
0
 private void connect_menuitem_Click(object sender, EventArgs e)
 {
     if (database == null)
     {
         dbpassdialog.ShowDialog();
         database = new Database(databasepassword);
     }
     if (database.TryConnect())
     {
         connection_statusstip.Text = "Połączono";
         connection_statusstip.Image = connect;
         EnableMenu(true);
     }
     else
     {
         MessageBox.Show(database.ExceptionMessage + "\n\n\nNumer:" + database.ExceptionNumber, "Błąd przy połączeniu z bazą", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (database.ExceptionNumber == 1045)
         {
             dbpassdialog.ShowDialog();
             database.ChangePassword(databasepassword);
         }
     }
 }
Exemplo n.º 2
0
 public void dbpass(string pass)
 {
     _dbpass = pass;
     database = new Database(_dbpass);
 }