How to check if datatable is empty or not?

Hi , When I scrap empty data table then I check it is empty or not
but it return false even if the datatable is blank


See the image

I want condition return true when dt is blank

@Sanket_Shinde1

Use this

dt.AsEnumerable.All(function(x) x.ItemArray.All(function(y) String.IsNullOrEmpty(y)))

cheers

I have to paste if condition?

I have paste is if condtion then get this error
image

@Sanket_Shinde1

Yes exactly

cheers

@Sanket_Shinde1

A small correction

IsNothing(dt) OrElse dt.AsEnumerable.All(function(x) x.ItemArray.All(function(y) String.IsNullOrEmpty(y.ToString)))

cheers

2 Likes

It works!!!
thank you so much Anil

1 Like

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