Private Function ColumnEqual(ByVal A As Object, ByVal B As Object) As Boolean
If A Is DBNull.Value And B Is DBNull.Value Then
Return True
End If
If A Is DBNull.Value Or B Is DBNull.Value Then
Return False
End If
Return A = B
End Function
.....
Public lastV As Object
...
For Each dr In wData.Rows
If lastV Is Nothing OrElse Not ColumnEqual(lastV, dr("table1")) Then
''check if first value is nothing
If lastV = Nothing Then
lastV = "00"
l = "0"
Else
dr("t1") = lastV
dr("n1") = l
End If
ListBox1.Items.Add(lastV & " <--> " & l)
lastV = dr("table1")
l = 1
ElseIf lastV Is Nothing OrElse ColumnEqual(lastV, dr("table1")) Then
l += 1
End If
Next
i use this code to loop through my datarow. It adds each record into a listbox but it does not add the last record in the datarow to the list.
Any help.
Thanks