I have a datatable in C # with a price column and a distribution column, and I need to multiply the price column by the distribution column and put the result in the price column. Is there a way to do this without looping over the table? I tried something like this:
DataTable dt = getData(); dt.Columns["Price"].Expression = "Allocation * Price";
But obviously this gives me the following exception:
Cannot set Expression property due to circular reference in the expression.
Does anyone know of a different way of doing this? Thanks in advance.
source share