Just before i give up on this method , i just want to post it here just in case someone sees what i am doing wrong.
I have this code to get the sum of items in a particular on a datatable and it works fine. No what i want to do is simply create a row at the end of my data table and write this sum in column 5 of that new row.
I am trying to achieve this in one invoke code…
and here is what i have but it doesn’t work
Dim AmountSum As String = dtInput.AsEnumerable.Sum(Function(x) Convert.ToDouble(x(in_TransactionAmountColumn).ToString.Trim) ).ToString
dtInput.Rows.Add(in_NumberOfEntries + 1)
dtInput.Rows(in_NumberOfEntries + 1).Item(in_TransactionAmountColumn)= AmountSum
where in_NumberOfEntries is the count of rows of the datatable before the introduction of the new row.
The code for the amount sum works, but the add data row and write to new data row is not working