Check if Datatable column contains empty row

Hi friends

I want to check if my column “Amount” contains any empty row without using for each.

image

In the above example , it should return “Yes” as the 1st row is empty.
do you have any idea.

@oshan You can use a Linq Query in this Way :

DT.AsEnumerable.Any(Function(x)String.IsNullOrEmpty(x(“Amount”).ToString) or String.IsNullOrWhiteSpace(x(“Amount”).ToString))

Where DT is your Datatable Variable.

2 Likes

@oshan
in case of you want to have more details have a look here:
Get_RowIdx-ColIdx_AnyBlankCells.xaml (9.3 KB)
producing such a log:
grafik

also you can modify with supermanPunch’s approach to get returned a True or False for rows with empty cells.

2 Likes