(From row In dt.AsEnumerable
Let a = CInt(row("Amoun1"))+CInt(row("Amount2"))+CInt(row("Amount3"))
Select dt.Clone.Rows.Add({row("Amoun1"),row("Amoun1"),row("Amoun1"),a})).CopyToDataTable
dt.AsEnumerable().ToList().ForEach(row =>
{
if (double.TryParse(row[“A”].ToString().Trim(), out double a) &&
double.TryParse(row[“B”].ToString().Trim(), out double b) &&
double.TryParse(row[“C”].ToString().Trim(), out double c))
{
row[“Total”] = a + b + (c / 100.0);
}
else
{
row[“Total”] = 0;
}
});
ok here i already have data table dt variable and iam creating a column Total by suing add data column activity and writing back the data in write range and iam giving data table name as dt
and after that iam using the assign expression to calculate the total amount of the 3 columns
so when i write back data again in write range i have to use the old variable dt to write back or create new datatable variable Please clarify
will the old variable dt holds the data of sum of the columns?