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(); }
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; }