public void LoadDataAsync() { if (_asyncQuery.IsExecuting) { return; } ClearResults(); _asyncQuery.Params.Clear(); _asyncQuery.AddParam("@ServerName",SqlDbType.VarChar, String.IsNullOrEmpty(txtServerName.Text) ? null : txtServerName.Text); _asyncQuery.AddParam("@DatabaseName", SqlDbType.VarChar, String.IsNullOrEmpty(txtDBName.Text) ? null : txtDBName.Text); _asyncQuery.AddParam("@ObjectName", SqlDbType.VarChar, String.IsNullOrEmpty(txtObjectName.Text) ? null : txtObjectName.Text); _asyncQuery.AddParam("@ObjectType", SqlDbType.VarChar, cmbObjectType.SelectedIndex == 0 ? null : ((ObjectType)(cmbObjectType.SelectedItem)).Abb); _asyncQuery.ConnectionString = ConfigHelper.Current.PragmaSqlDbConn.ConnectionString; string cmdText = "exec spPragmaSQL_ObjectChangeHist_List @ServerName, @DatabaseName, @ObjectName, @ObjectType"; if (String.IsNullOrEmpty(cmdText)) { return; } _asyncQuery.CommandText = cmdText; _asyncQuery.Execute(); btnList.Enabled = false; btnStop.Enabled = true; SetInputControlsEnabled(false); }
private void LoadDataAsync() { if (_asyncQuery.IsExecuting) { return; } ClearResults(); _asyncQuery.ConnectionString = _connParams.ConnectionString; string cmdText = _criterias.BuildSearchScript(); if (String.IsNullOrEmpty(cmdText)) { return; } _asyncQuery.CommandText = cmdText; _asyncQuery.Execute(); lblProgress.Text = "Search in progress. Please wait..."; Icon = global::PragmaSQL.Properties.Resources.hourglass; Program.MainForm.DockPanel.Refresh(); //btnAddCriteria.Enabled = false; //btnRemoveCriteria.Enabled = false; //btnStartSearch.Enabled = false; //btnChangeDb.Enabled = false; //btnStopSearch.Enabled = true; //cmbServers.Enabled = false; //cmbDatabases.Enabled = false; DisableToolStripButtons(true); }
public void ExecuteAsync(ConnectionParams cp, string commandText) { if (IsExecutingAsync) { throw new Exception("Query is already executing!"); } ClearAll(); asyncQry = new AsyncQuery(cp.ConnectionString, commandText); asyncQry.AfterExecutionCompleted += new ExecutionCompletedDelegate(qry_AfterExecutionCompleted); asyncQry.Execute(); }