Hi, all. I need a little advice on a school web project. I'm using VS2010/VB/ASP
Some background: I have a listbox(LBX) and a dropdown list(DDL). Each are bound to their own AccessDataSource objects, which in turn are bound to different tables in a database. Each is successfully populated from their respective datasources.
What I want to do is compare the items in each, one by one, and remove items from the DDL which are already present in the LBX. The long term idea is that when a user selects an item in the DDL, it will be moved from the DDL to the LBX. There is no point in having an item in the DDL which is already in the LBX.
I don't want to instantly transfer all differing items, I just want to prepare the DDL for the user to select what to transfer. I have a nested For Each loop so far. It isn't giving me any errors, it just isn't removing anything!
For Each item1 In DDL.Items For Each item2 In LBX.Items If DDL.SelectedItem.ToString = LBX.SelectedItem.ToString Then DDL.Items.Remove(DDL.SelectedItem.ToString) End If Next Next
Can anyone point out what I'm doing wrong? I've looked here Click Here but been unable to determine my error(s).