我创建了一个动态查询,它可以从外部 BAQ 返回数据集。我希望动态查询只返回符合我解析的参数的记录。
这是我到目前为止的代码:
// DynamnicQuery for BAQ
Epicor.Mfg.Core.Session epiSession = default(Epicor.Mfg.Core.Session);
epiSession = (Epicor.Mfg.Core.Session)POEntryForm.Session;
DynamicQuery dynamicQuery = new Epicor.Mfg.BO.DynamicQuery(epiSession.ConnectionPool);
//Build Data Set
QueryExecutionDataSet executionDS = new QueryExecutionDataSet();
//Build parametors
QueryExecutionDataSet parameters = new QueryExecutionDataSet();
DataRow paramRow = parameters.ExecutionParameter.NewRow();
paramRow["ParameterName"] = "POSuggestionsView.PartNum";
paramRow["ParameterValue"] = "10050886";
paramRow["ValueType"] = "nvarchar(50)";
paramRow["IsEmpty"] = "False";
paramRow["RowIdent"] = "";
paramRow["RowMod"] = "";
paramRow["DBRowIdent"] = new byte[0];
parameters.ExecutionParameter.Rows.Add(paramRow);
// Out variable which indicates if more results are available (likely for use with topNRecords)
bool hasMoreRecords = false;
//Executed named BAQ with parameter...
DataSet results = dynamicQuery.ExecuteByIDParametrized("AD-999-SB_POSuggestion", parameters, "", 0, out hasMoreRecords);
//Message Each Description....
MessageBox.Show("Number of rows in Results = " + results.Tables["Results"].Rows.Count.ToString());
foreach (DataRow item in results.Tables["Results"].Rows)
{
MessageBox.Show("Row Value = " + item["POSuggestionsView.PartNum"].ToString());
}
我创建的代码仍然返回表中的所有值,而不将返回的行限制为满足参数条件的行。任何人都可以帮我解释为什么会这样吗?