My variables are amounts lets say from invoice. There can be plenty of them. ANd I have one row of invoice in one row of DT. So I go through rows and read the amounts if some conditions are met. Then I get for example 22.98, 33.44 etc. which must be double if I wanna do a sum, right? But when you do not fill anything into the DT it throws error when I do the sum which you can see above. Moreover, it is not possible to set the default value in the DT to be zero.
In the end I do this for three types of amounts. One which is taken into account, one which is not and special type. ON the invoice I have just total so I need to check the total sum of them.
Convert.ToDouble(DT1.Compute(“sum([amounts])”,"")) + Convert.ToDouble(DT2.compuute(“sum([amounts])”,"")) + Convert.ToDouble(DT3.Compute(“sum([amounts])”,"")) cannot be in try catch because I dont know which of them is the null DT.
TO be more precise I have it as a condition in IF activity that total=sumofDT1+sumofDT2…