>Dim result_Match = > (From Row In result_0 > Where OptionCheck_WithArray(Row.SecurityCode) > Select Row).ToList() > >Public Function OptionCheck_WithArray(ByVal n_Value2 As Integer) As Boolean > ' TODO: need to loop through array > Return If((n_Value2 And SecurityCodes(0)) = SecurityCodes(0), True, False) >End Function>The result_0 list/collection is the result of my earlier select and has records. It also has a value of 102 (in this example) in the SecurityCode field for all the records.
Dim results As New List(Of DummyRow)() results.Add(New DummyRow(New List(Of Integer)() From {1, 4})) results.Add(New DummyRow(New List(Of Integer)() From {4, 8})) results.Add(New DummyRow(New List(Of Integer)() From {4, 16})) Dim UserCodes As New List(Of Integer) From {1, 8} Dim MR As List(Of DummyRow) = (From x In results Where OptionCheck_WithArray(x.Codes, UserCodes) Select x).ToList()with
Public Function OptionCheck_WithArray(ByVal userCodes As List(Of Integer), ByVal test As List(Of Integer)) As Boolean For Each i As Integer In test If userCodes.Contains(i) Then Return True End If Next Return False End FunctionBut *please*, since this is essentially a bitwise comparison, consider using Enums instead. Why use an array of integers when one would do. If you need more options use a Long instead of an Integer. Of course if you *do* need more than 64 then you will have to stick with a List...