Hi
I am getting “the Source Contains no datarows” error for the below link query
Assign -
DtTempMaterial =
(From a In DtTempMaterial.AsEnumerable() Group Join b In DtCompare.AsEnumerable() On a(“Material Number”).ToString Equals b(“Material”).ToString
Into g = Group From check In g.DefaultIfEmpty() Where check Is Nothing
Select a).CopyToDataTable
So Basically, I am removing materials from DtTempMaterial that has matching Materials in DtCompare table and the remaining materials will be in DtTempMaterial. I checked both the data tables. They have values inside it. Column names also I checked. It is correct.
@esakki1612 ,
The error is since there is no rows in datatable to return to the assign function, there is input data found but as there is some conditions , may the rows coudnt satisfy the condition and returnes 0 rows
Exactly. I thought the same. Actually there are 2 records in both the tables. Both the records are matching.So The records are removed from DtTempMaterial. At the end of this assign, DtTempMaterial wouldn’t have any rows in it. So The issue is because of that?
I want the assign to get executed and let the DtTempMaterial be empty. How can we achieve it?
Got the solution for this…Thank you
I handled it with a Try Catch . if there are empty rows, I have put DtTempMaterial.clone() in the catch which resolved my issue
Hey the error is due to query returned zero rows.
The query conditions did not satisfied to return the output rows
To rectify this issue
please use a assign activity
dttable=if(yourquery.count>0, pass the query, dt.clone)
This will check if your query count is greater than zero or not if yes means the query out will save to your datatable else datatable will cloned to this datatable.