Пример #1
0
 private bool TestDbConn()
 {
     DBConnect dbc = new DBConnect();
     if (dbc.TestConnection())
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Пример #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     Properties.Settings.Default.username = dbuname.Text;
     Properties.Settings.Default.password = dbpwd.Text;
     Properties.Settings.Default.dbname = dbname.Text;
     Properties.Settings.Default.server = dbserver.Text;
     Properties.Settings.Default.dbport = dbport.Text;
     Properties.Settings.Default.Save();
     DBConnect dbc1 = new DBConnect();
     if (dbc1.TestConnection())
     {
         MessageBox.Show("DB Connection Successful! Settings Saved");
         loadMachineNames();
     }
     else
     {
         MessageBox.Show("DB Connection Failed!");
     }
 }