Example #1
0
    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);
    }