Source contains no datarows

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.

Can someone help me out on this pls

Thanks

HI @esakki1612

Check out this tutorial

Regards
Gokul

@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?

HI @esakki1612

Use Try catch block surround the Assign activity

Some thing like this you can try

image

Regards
gokul

1 Like

Hi @esakki1612,

If any data in the column you filtered is blank, you will get the error you sent.

Can you check that any value in the specific column you’re filtering is not blank in your table?

Regards
Ömer

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

1 Like

Great @esakki1612

Kindly close this topic by mark as solved. It will help for other too.

Regards
gokul

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.

Regards

Sreejith S S

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.