DT how to replace values from specific column to other values

Hi All,

I have a DT let’s say 3 column and in last column I have some numbers.
I have to multiply all values from last column by 2 and replace old values by those new values and receive a new DT.

Thank you!

Hey @niteckam

For each row in dt:
row(2) = (CDbl(row(2).ToString) * 2).ToString

After this, dt will have its last column updated.
If you need the values in another datatable dt2 = dt.Copy() and then use For Each row for dt2, as above.

Attached an example of how to do this. The code assumes that the values are doubles, much like @alin.c.mihalea 's example.

Processusvierge.zip (13,9 Ko)