How to judge the dataTable's all the cell was blank?

activities

#1

How to judge the dataTable’s all the cell was blank?
Like this:
column1,column2
blank, blank


#2

Hi @jmy

(From q in testRow.Select() where string.Join("",q.ItemArray).Trim.Equals(string.Empty) select q).ToArray().Count>0

True->In data table empty row are there.

For More information about Datatable operations

Regards,
Arivu


#3

@jmy

If you want check all the cells in the datatable is empty then try like this

(From p In dt.Select
where p.ItemArray.ToList.All(Function(x) string.IsNullOrEmpty(x.ToString))
Select p).ToArray.Count=(dt.Rows.Count)

Regards,
Mahesh


#4

I’m sorry to bother you
But I can’t get your idea?
1.which grammar did you used? db?
2. how can I reply it with uipath activity.
thank you very much


#5

@jmy

I applied Linq.
You can use this in Assign activity.

Regards,
Mahesh


#6

use this line?
p.ItemArray.ToList.All(Function(x) string.IsNullOrEmpty(x.ToString))Select p).ToArray.Count=(dt.Rows.Count)

actually it was only one line in the datatable.

it was created like this:
1,read range with head.
2,for eachRow called L
3,use add data column activity ,add L to another datatable.
4,use remove data column activity,to remove the column that I know it was not blank.
5,the column with blank cell was on hold.
so I wank to make sure(judge) it is all blank.
thank you


#7

VersionUP.xaml (1.9 KB)


#8

test.xaml (20.4 KB)