Check if a column has a different value

Currently I am working with a datatable in which I have a column called “Status” this column can have multiple values ​​but I must validate if all the values ​​in this column are “Complete”.

How can I validate this? I’m trying to avoid using For each and putting everything on one line that gives me a True or False value.

give a try on

Assign activity
LHS: chk | Boolean
RHS

YourDataTableVar.AsEnumerable.All(Function (x) x("Status").toString.Trim.ToUpper.Equlals("COMPLETE"))
1 Like

It works, Thank you!

Don’t. There is no reason to avoid For Each. You think by doing it with LINQ you’re avoiding looping but you’re not. LINQ still has to loop, it’s just buried inside making you less aware of it.

Just use For Each. Simpler to design, simpler to debug, simpler for others to understand in the future.

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