I have an array built from a table which I need to search values in..
Private marrOutscomesStart(2, 100000)
Dim i As Integer = 0
If Not rstType.BOF And Not rstType.EOF Then
While Not rstType.EOF
If Not IsDBNull(rstType.Fields(0).Value) Then
marrOutscomesStart(0, i) = rstType.Fields(0).Value
marrOutscomesStart(1, i) = rstType.Fields(1).Value
i = i + 1
End If
rstType.MoveNext()
End While
End If
The data in the array will be something like this:
0 -- [Apple], [1], [Y]
1 -- [Apple], [2], [N]
2 -- [Apple], [3], [Y]
3 -- [Pear], [1], [Y]
4 -- [Pear], [2], [N]
5 -- [Banana], [1], [Y]
I would like to search for Column 1 = Apple and Column 2 = 2 and get the index of the array item.. I can loop through the array but is there a faster way to search for 2 column values?
Many thanks,
Derek.