Hi
I am trying to check where an item in my array list exists in the database.
The list would have already been created at an earlier stage.
Now that some items may have been removed from the database, I wish to check the list against that database before removing the items, from the list, which are no longer in the database.
The following code removes all items from the list rather than just each one which doesnt exist.
While rdr.Read
'look for and remove errors that don't exist in
For Each listitem In mylist
If Not listitem.ID = rdr("ID") Then
mylist.Remove(listitem)
End If
Next
End While
Any thoughts? I am sure this can't be too far away.
I am trying to check where an item in my array list exists in the database.
The list would have already been created at an earlier stage.
Now that some items may have been removed from the database, I wish to check the list against that database before removing the items, from the list, which are no longer in the database.
The following code removes all items from the list rather than just each one which doesnt exist.
While rdr.Read
'look for and remove errors that don't exist in
For Each listitem In mylist
If Not listitem.ID = rdr("ID") Then
mylist.Remove(listitem)
End If
Next
End While
Any thoughts? I am sure this can't be too far away.