I’m not sure I understand the question entirely, but utilizing the dynamic query adapter will allow you to interact with the results of the baq as a dataset and from there you can perform your selection/filter/count operations like so:
//Call a Dynamic Query (BAQ) adapter and return results to a grid
//This is especially useful when returning data to a custom grid without needing to format the column headers in code.
private void btnGet_Click(object sender, System.EventArgs args)
{
//use dynamic query to populate grdBPM
DynamicQueryAdapter adapterQuery = new DynamicQueryAdapter(oTrans);
adapterQuery.BOConnect();
adapterQuery.ExecuteByID("YourBAQIDHere");
DataSet ds = adapterQuery.QueryResults;
adapterQuery.Dispose();
grdDisplayResults.DataSource = ds;
}
//Call a Dynamic Query adapter with parameters
//Multiple parameters can be added, just add a new parameter row
private DataSet getInfoFromQuery(string partNum)
{
DataSet dsLots = new DataSet();
DynamicQueryAdapter qryAvailableLots = new DynamicQueryAdapter(oTrans);
QueryExecutionDataSet parameters = new QueryExecutionDataSet();
//set parameter: partNum
DataRow paramRow = parameters.ExecutionParameter.NewRow();
paramRow["ParameterID"] = "PartNum";
paramRow["ParameterValue"] = partNum;
paramRow["ValueType"] = "varchar(50)";
paramRow["IsEmpty"] = "False";
paramRow["RowMod"] = "";
parameters.ExecutionParameter.Rows.Add(paramRow);
qryAvailableLots.BOConnect();
qryAvailableLots.ExecuteByID("YourParamQueryHere", parameters);
dsLots = qryAvailableLots.QueryResults;
qryAvailableLots.Dispose();
return dsLots;
}
The query results are where you interact with the data returned from the dynamic query.