No Rows in my DataTable

Hi everyone.
Hopefully, someone can help. I have the code below which compile with no errors but when it runs there are no rows in the dtJobStatus table. Can anyone tell me where I have gone wrong?
Thanks in advance

private void getJobStatus()
        EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));
		System.Data.DataRow edvOrderDtlRow = edvOrderDtl.CurrentDataRow;
		if (currentOrder != (int)edvOrderDtlRow["OrderNum"]);
			currentOrder = (int)edvOrderDtlRow["OrderNum"];
		if (edvOrderDtlRow != null)
        DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
        QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("Job-Status");
        qeds.ExecutionParameter.AddExecutionParameterRow("Job-Status", currentOrder.ToString(), "nvarchar", false, Guid.NewGuid(), "A");
        dqa.ExecuteByID("Job-Status", qeds);
        dtJobStatus = dqa.QueryResults.Tables["Results"];
		if (dtJobStatus.Rows.Count > 0)
		int row = 0; 
		for (row = 0; row < edvOrderDtl.dataView.Table.Rows.Count - 1; row++ )
				edvOrderDtl.dataView.Table.Rows[row]["tbIssued_c"] = dtJobStatus.Rows[row]["Calculated_Message"].ToString();				

Please share the Job-Status baq.

Hi @Hari_Dutt,
Here is the output from the BAQ;

Please export the baq and attach.

Ah, I see. sorry.
Job-Status.baq (45.8 KB)

When you add the parameter to the BAQ call, the first string parameter needs to be the name of the BAQ Parameter, not the BAQ itself. It looks like it should be:

qeds.ExecutionParameter.AddExecutionParameterRow("OrderNumber",currentOrder.ToString(), "nvarchar", false, Guid.NewGuid(), "A");
1 Like

Thanks Tyler, that fixed it :slight_smile: