How to find if the value in particular column is empty or not

S.no. Value

  1.             2
    
  2.             40
    
  3.             59
    
  4.              60
    

Here you can see the line number 4 value column has no value it is empty

I need to check it is empty or not and my output should in Boolean ie true or false

Note: should not used for loop

Hi @sruthesanju

Try this

YourDataTable.AsEnumerable().Any(Function(row) String.IsNullOrWhiteSpace(row("Value").ToString()))

Regards,

Hi @sruthesanju

Try this:

Assign: isEmpty = If(yourDataTable.AsEnumerable().Any(Function(row) String.IsNullOrWhiteSpace(row("Value").ToString())), True, False)

Hope it helps!!

@sruthesanju

String.IsNullOrEmpty(yourDataTable.Rows(3)("column_name").ToString)

Hi @sruthesanju ,

Could check with what @Parvathy as provided but maybe not needed to re-validate again :

yourDataTable.AsEnumerable().Any(Function(row) String.IsNullOrWhiteSpace(row("Value").ToString))

Hi @sruthesanju

Use the below linq expression,

- Assign -> Bool_Flag = dt.AsEenuemarable.any(Function(X) String.isNullorEmpty(X("Value").toString))

The above expression will work, if any row in the Value column is empty then it will throw the True as output else false.

Note - Bool_Flag is the Boolean datatype variable.

Hope it helps!!

@sruthesanju

dt.AsEnumerable.any(Function(a) string.IsNullOrEmpty(a("Value").ToString.Trim))

or you can use

dt.AsEnumerable.any(Function(a) string.IsNullOrEmpty(a(0).ToString.Trim))

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