Need a way to go about this problem

Continuing the discussion from Need a linq query to solve this issue:

i want another column adjacent to the validation column(please add it as Status) to show all names of columns comma seperated which are showing values other than “NoChange”.

@P-A-J

First add a new column names status …and then inside loop try this

CurrentRow("Status") = String.Join(",",dt.Columns.Cast(Of DataColumn).Select(Function(m) m.ColumnName.ToString).Where(function(x) Not currentRow(x).ToString.Equals("NoChange")))

Cheers

I have an ID column and Validation Column , i dont want those two columns to be considered in the condition.

@P-A-J

Try this

CurrentRow("Status") = String.Join(",",dt.Columns.Cast(Of DataColumn).Select(Function(m) m.ColumnName.ToString).Where(function(x) Not currentRow(x).ToString.Equals("NoChange") AndAlso Not {"ID","Validation"}.Contains(x)))

Cheers

1 Like

Can you exclude column ID from this query

If(CurrentRow.ItemArray.All(Function(x) x.ToString.Trim.Equals(“NoChange”)),“OK”,“Error”)

@P-A-J

You can use same andalso query here as well…hope you got it

Cheers

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