I have excel data where C column is formatted with currency
and have converted the column C type into double
and iam doing sum of other 2 columns A and B and wring the value in C column
but when iam reading C column Value it is throwing error as conversion from sting to type double in invalid
can anyone tell what is going wrong?
Take a Assign Activity,
dt_Output = dt_Input
Note: dt_Input is Datatable Variable of Read Range, dt_Output datatype is also Datatable.
Using below mentioned LinQ in assign activity,
Left Side: dt_Output
Right Side:
From row in dt_Input
Let Total_Sum = CDbl(row("ColumnA").ToString.Replace("$","").Replace(",","")) + CDbl(row("ColumnB").ToString.Replace("$","").Replace(",",""))
Select dt_Output.Rows.Add(row("ColumnA").ToString,row("ColumnB").ToString,Total_Sum.Tostring)
Using Above LinQ, you will get final output in dt_Output variable as expected!