Linq Query to sum DataRows RRS feed

  • Question

  • I need to sum corresponding elements in  two data rows except the first element. The first element  is string.  how can i do this?

    Here the corresponding rows have same data types. But each row contain Int32, decimal data type values. 

    The resulting sum should be inserted into the datatable as the last row. The first element in the row is string 'Total'. I need to sum of the remaining values.

    row 1: Total A, 200, 222.567, 300, 400.555  

    row 2: Total B, 300, 111.432,600, 300.444

    Result: Grand Total, 500,  333.999, 900, 700.999

    Friday, October 14, 2016 8:41 AM