I have a For each row loop inside another for each row loop and my 2 datatables have the same number of columns, just different values. I compare and assign the value back into the outer loop
code to get value: CStr(if(CurrentRowDTtoday(0).ToString.Contains(rowitem(0).ToString),Cint(rowitem(“Number of reminders”).ToString)+1,0)))
but when calling value from inner loop i don’t get it. Can anyone tell me why and is there another solution to this problem (linQ for example)?. I have attached a picture below. Thank you
unfortunately db_OutPut cannot be inspected from the screenshot
for a more reliable tracing within the debugging panels put a comment activity under the assign activity (where the IF… is used). So we can rely that it is entered safe enough into the scope od rowitem
I a lot of scenarios we also have other option for pairing / comparing 2 datatables.
I have 2 input tables as shown. If the value in column(0) of input1 appears in column(0) of input2, the value of column(last) of input2 will be added to 1. For example, if OR02826553 appears in both input tables, then The value of column(last) input 2 is 2+1 = 3 and if not then the value is filled in with 0
I have 2 input tables as shown. If the value in column(0) of input1 appears in column(0) of input2, the value of column(last) of input2 will be added to 1. For example, if OR02826553 appears in both input tables, then The value of column(last) input 2 is 2+1 = 3 and if not then the value is filled in with 0. So I use a loop of 2 for each row to check them
For Each row1 As DataRow In dt.AsEnumerable
For Each row2 As datarow In dt2.AsEnumerable
If row1(0).ToString.Trim.Equals(row2(0).ToString.trim) Then
row2(“Number of reminders”)=CInt(row1(“Number of reminders”).ToString)+1
Else
row2(“Number of reminders”)=“0”
End If
Next
Next