Hello everyone,
I got problem with my DataTable, where there are multiple rows and columns. I need to extract data from spesific index of row and coulum. Kind like this, for the row I need to start from Index 1, and column start from Index-7. I’ve tried:
Using “foreach loops row” from DataTable
ForEach rowPosition in dataTable
ForEach row in RowPosition
Not working because the output of rowPosition is DataRow.
Using Assign to get the index both for row and column, then put it into datatable
rowIndex = dataTable.Rows.IndexOf(rowPosition)+1
columnIndex = dataTable.Columns.IndexOf(“columnName”)+1
dt2 = dtPayment.Rows(rowIndex)(columnIndex)
Not working because of disallows converstion From Object To DataTable
Using Add Data Row from Activities, where
ForEach rowPosition in dataTable
AddDataRow
Input = rowPosition
Output = newDT
Not working because of “Add Data Row: Object reference not set to an instance of an object.”
Those have about monthly payment, so it consists 24 column (to put currency), need to check the price gap, which indicate if the bill of previous or current already paid or not. Column1 consist of need-to-payColumn2 consist of the real-payment. With condition like this:
Column7 - Column8 != 0, give messages need-to-pay.
@kristoff Ok. I guess the Calculation part that you have to do is based on Subtraction of each two Column values of a row starting from Column 7. But can you Show us the Output Format that you expect for that data?
@supermanPunch, I tried to subtraction the column that consist of currency by creating the nested for each row loops, but the second loop couldn’t working because the input I used for the second loop is DataRow. Now I need to assign this DataRow (by selecting only the currency) into DataTable. My expect output is got result of the substraction.