Example #1
0
        /// <summary>The execute query.</summary>
        /// <param name="sql">The sql.</param>
        public void ExecuteQuery(string sql)
        {
            if (IsBusy)
            {
                _hostWindow.DisplaySimpleMessageBox(this, "Please wait for the current operation to complete.", "Busy");
                return;
            }

            if (_settings.ConnectionDefinition == null)
            {
                _hostWindow.DisplaySimpleMessageBox(this, "Please select a connection.", "Select a Connection");
                return;
            }

            lock (_syncLock)
            {
                IsBusy = true;
            }

            _runner = QueryRunner.Create(_settings.ProviderFactory, _settings.ConnectionDefinition.ConnectionString, _settings.EnableQueryBatching, _settings.CommandTimeout);
            UseWaitCursor = true;
            queryBackgroundWorker.RunWorkerAsync(sql);
        }
 public void No_connection_expects_error_on_Execute()
 {
     _runner = new QueryRunner(DbProviderFactories.GetFactory("System.Data.SqlClient"), null, true, 30);
     _runner.ExecuteQuery(" ");
 }
 public void No_provider_expects_error_on_Execute()
 {
     _runner = new QueryRunner(null, _conn, true, 30);
     _runner.ExecuteQuery(" ");
 }
 public void TestSetUp()
 {
     _runner = QueryRunner.Create(DbProviderFactories.GetFactory("System.Data.SqlClient"), _conn, true, 30);
 }