private void btnGetAllDataBases_Click(object sender, EventArgs e) { if (cmbSqlServers.Items.Count > 0 && txtPassword.Text.Trim().CompareTo(string.Empty) != 0 && txtUserName.Text.Trim().CompareTo(string.Empty) != 0) { ticker.Start(); btnGetAllDataBases.Enabled = false; this.Cursor = Cursors.WaitCursor; cmbAllDataBases.Items.Clear(); sqlInfo.SQLServer = cmbSqlServers.Text.Trim(); sqlInfo.Username = txtUserName.Text.Trim(); sqlInfo.Password = txtPassword.Text.Trim(); MessageBox.Show("You may get the list sql servers if user name and password are not correct.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 0, false); intlDelg = new InternalDelegate(sqlInfo.EnumerateSQLServersDatabases); called = CallFor.SqlDataBases; intlDelg.BeginInvoke(new AsyncCallback(CallBackMethod), intlDelg); } else { MessageBox.Show("No sql servers loaded or user name or password empty...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, 0, false); } }
private void btnLoadSqlServers_Click(object sender, EventArgs e) { ticker.Start(); btnLoadSqlServers.Enabled = false; this.Cursor = Cursors.WaitCursor; cmbSqlServers.Items.Clear(); cmbSqlServers.Items.Add(MyModules.ServerName); called = CallFor.SqlServerList; intlDelg.BeginInvoke(new AsyncCallback(CallBackMethod), intlDelg); cmbSqlServers.Text = MyModules.ServerName; }