protected void FillParameters(SharpQueryParameterCollection parameters) { SharpQueryParameter par = null; for (int i = 0; i < parameters.Count; i++) { par = parameters[i]; if (par.Type == ParameterDirection.ReturnValue) { i--; parameters.Remove(par); } } this.dataGrid.CaptionVisible = true; this.dataGrid.DataSource = parameters; this.dataGrid.DataMember = null; this.dataGrid.AllowNavigation = false; }
///<summary> /// allow the user to add some parameters while executing an SQL command /// </summary> protected override SharpQuerySchemaClassCollection OnExecute(CancelEventArgs e) { SharpQuerySchemaClassCollection tmp = this.SchemaClass.GetSchemaParameters(); SharpQueryParameterCollection parameters = null; SharpQuerySchemaClassCollection returnValue = null; if (tmp.Count == 1 && tmp[0] is SharpQueryNotSupported) { parameters = new SharpQueryParameterCollection(); } else { parameters = new SharpQueryParameterCollection(); foreach (SharpQueryParameter par in tmp) { parameters.Add(par); } } if (parameters != null && parameters.Count > 0) { inputform = new SQLParameterInput(parameters); inputform.Owner = (Form)WorkbenchSingleton.Workbench; if (inputform.ShowDialog() != DialogResult.OK) { returnValue = null; e.Cancel = true; } else { returnValue = new SharpQuerySchemaClassCollection(); foreach (SharpQueryParameter par in parameters) { returnValue.Add(par); } } } return(returnValue); }
public SQLParameterInput(SharpQueryParameterCollection parameters) : this() { this.FillParameters(parameters); }
///<summary> /// allow the user to add some parameters while executing an SQL command /// </summary> protected override SharpQuerySchemaClassCollection OnExecute(CancelEventArgs e) { SharpQuerySchemaClassCollection tmp = this.SchemaClass.GetSchemaParameters(); SharpQueryParameterCollection parameters = null; SharpQuerySchemaClassCollection returnValue = null; if (tmp.Count == 1 && tmp[0] is SharpQueryNotSupported) { parameters = new SharpQueryParameterCollection(); } else { parameters = new SharpQueryParameterCollection(); foreach (SharpQueryParameter par in tmp) parameters.Add(par); } if (parameters != null && parameters.Count > 0) { inputform = new SQLParameterInput(parameters); inputform.Owner = (Form)WorkbenchSingleton.Workbench; if (inputform.ShowDialog() != DialogResult.OK) { returnValue = null; e.Cancel = true; } else { returnValue = new SharpQuerySchemaClassCollection(); foreach (SharpQueryParameter par in parameters) { returnValue.Add(par); } } } return returnValue; }