public void RunQuery(GlobalVariableCollection vars) { string[] qryStr; if (this.txtQuery.SelectedText.Length > 0) { qryStr = this.txtQuery.SelectedText.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); } else { qryStr = this.txtQuery.Lines; } string qry = string.Empty; if (vars != null) { for (int i = 0; i < vars.Count; i++) { qry += string.Format("DECLARE @{0} {1} SET @{0} = {2} ", vars[i].VariableName, vars[i].VariableType, vars[i].VariableValue); } } this._dataQry = new DataQuery(this.DatabaseProvider, this.ConnectionString, qry + rsData.DeCommentQuery(qryStr)); this._dataQry.ExecuteStarted += new EventHandler(this.dataQuery_onExecuteStart); this._dataQry.ExecuteStopped += new EventHandler(this.dataQuery_onExecuteStopped); this._dataQry.ExecuteAbort += new EventHandler(this.dataQuery_onExecuteAbort); //this._dataQry.ResultStart += new ResultStartedEventHandler(this.dataQuery_onResultStart); //this._dataQry.ResultComplete += new EventHandler(this.dataQuery_onResultComplete); //this._dataQry.RecordProcessed += new RecordReadEventHandler(this.dataQuery_onRecordProcessed); this._dataQry.BeginExecuteQuery(); }
internal frmTemplateVars(GlobalVariableCollection varCol) : this() { for (int i = 0; i < varCol.Count; i++) { this.lstVars.Items.Add(varCol[i].VariableName); } }