Beispiel #1
0
 private void btnLogin_Click(
     object sender,
     EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     switch (chkWinAuth.CheckState)
     {
         case CheckState.Checked:
             AConnection = new Connection();
             AConnection.CreateConnection
                 (
                     txtUsername.Text,
                     txtPassword.Text,
                     cmbServer.Text,
                     cmbDataBase.Text,
                     "WIN");
             break;
         default:
             AConnection = new Connection();
             AConnection.CreateConnection
                 (
                     txtUsername.Text,
                     txtPassword.Text,
                     cmbServer.Text,
                     cmbDataBase.Text,
                     "SQL");
             break;
     }
     ADatabases = new GetDatabases();
     cmbDataBase.DataSource = ADatabases.GetSqlDataBases(AConnection);
     AConnectionIsOpen = AConnection.IsConnectionOpen();
     Cursor = Cursors.Default;
     aformtoConnect.Show();
     this.Hide();
 }
Beispiel #2
0
 private void cmbDataBase_BeforeDropDown(
     object sender,
     CancelEventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     switch (chkWinAuth.CheckState)
     {
         case CheckState.Checked:
             AConnection = new Connection();
             AConnection.CreateConnection
                 (
                     txtUsername.Text,
                     txtPassword.Text,
                     cmbServer.Text,
                     "",
                     "WIN");
             break;
         default:
             AConnection = new Connection();
             AConnection.CreateConnection
                 (
                     txtUsername.Text,
                     txtPassword.Text,
                     cmbServer.Text,
                     "",
                     "SQL");
             break;
     }
     ADatabases = new GetDatabases();
     cmbDataBase.DataSource = ADatabases.GetSqlDataBases(AConnection);
     Cursor = Cursors.Default;
 }