Compare two column and update to another column through linq

Hi,

Hope the following sample helps you.

img20210611-2

dt = dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r("Col A"),r("Col B"),if(r("Col A").ToString.Contains("Needed") AndAlso r("Col B").ToString.ToUpper="TRUE","Present",r("Col C"))  ,r("Col D")},False)).CopyToDataTable

Sample20210611-2.zip (8.4 KB)

Regards,

2 Likes