Rows.count returns cannot access - public location reference

Hi Team,

I used copytodatatable but returned error if there was no rows so i collected the result in datarows and checking if datarows.count>0 but it is throwing below error.

image

This is the query used in an assign activity - (from dt in dta.Select() where Not existingIDNumber.Contains((dt(“ID number”).ToString)) Select dt)

Thanks,
Ula

@Boopathi What is the type of datarows?

To address this issue - check the Datatable not nothing and check the row count…


Try to use the FilterDataTable Activity and filter the results based on your requirements. It will results empty result datatable when zero results.

@Boopathi
Bring the result to a list of datarows Like

(from dt in dta.Select()
where Not existingIDNumber.Contains((dt(“ID number”).ToString))
Select dt).ToList

Then the Count should work