Hi Varun,
You have two tables, not one, where the index can be different.
I do not know what kind of array you have and therefore i take another
approach
I have typed it here, so watch errors or typos
\\\
dim i as integer
For i = 0 to MyArray.count -1
'We go through the array
dim y as integer = combobox1.findstringexact(trim(myarray(i)))
'If we find it y is the index of the combobox row else it is -1
if y<>-1 then
combobox1.items.removeAt(y)
end if
next
///
As said not tested just typed here.
You can try it?
Cor
Hello,
I am trying to make the items in my combobox be removed if they are
present in my array. I cant however get my code to work. The values are read into my combobox
using a datareader. I then want to remove items from the items collection of
the combobox if they are in my array. Here is what i try:
If i > 0 Then
For i= 0 To (MyArray.Count - 1)
Combobox1.Items.Remove(MyArray)
Next i
End If
can someone tell me what the problem could be?
thank you