In the BAQ designer I have this option to add values:
How can I do it with code? I’m using this code to execute the BAQ
// Declare and create an instance of the Adapter.
DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(this.oTrans);
adapterDynamicQuery.BOConnect();
// Declare and Initialize Variables
string BAQName = "FiscalPeriod";
Ice.BO.QueryExecutionDataSet ds = new Ice.BO.QueryExecutionDataSet();
// Add Parameter Rows
// Definition: AddExecutionParameterRow(string ParameterID, string ParameterValue, string ValueType, bool IsEmpty, Guid SysRowID, string RowMod)
// Possible ValueTypes: nvarchar, int, decimal, date, datetime, bit, uniqueidentifier, bigint
// IsEmpty indicates if your passed value Is Empty because if it is, you can define in your params to use a default value if empty.
// Typically you use string.IsNullOrEmpty(yourValueVariable) but if you are hard coding a value then you can simply set it to false
ds.ExecutionParameter.AddExecutionParameterRow("FiscalYear", "2016", "int", false, Guid.Empty, "A");
ds.ExecutionParameter.AddExecutionParameterRow("FiscalPeriod", "10", "int", false, Guid.Empty, "A");
// Call Adapter method
adapterDynamicQuery.ExecuteByID(BAQName, ds);
// Lets Loop through our results
if (adapterDynamicQuery.QueryResults.Tables["Results"].Rows.Count > 0)
{
dgDatos.DataSource = adapterDynamicQuery.QueryResults.Tables["Results"];
}
// Cleanup Adapter Reference
adapterDynamicQuery.Dispose();
MainController.Cursor = Cursors.Default;
} catch (System.Exception ex)
{
MainController.Cursor = Cursors.Default;
ExceptionBox.Show(ex);
}