I want Substract one column A Date from an another column B in same datatable using linq and save result to third column C

Hi @Palaniyappan

I want to copy one column value to an another column using linq. Could you please let me know how can it be done?

Currently, using for each row, copying column1 to newly created column2 but want to do using linq. Also want other column values to be included in the datatable.

Thanks,
Boopathi

Hi @Boopathi

It can done easily using this code in invoke code activity

Suppose we had tow columns in datatable dt1

col1, col2

Suppose one column is created it’s name is col3

Now to copy values from col2 to col3

Use this code in invoke code with dt1 as in/out argument

dt1.AsEnumerable().ToList().ForEach(Sub(row) row(“col3”)= row(“col2”).ToString)

1 Like