Search table with x number of arguments
<p>I'm trying to find a desired row index of a table(s). Difficulty is that I need to check multiple values found in the columns.</p>

<p>For example.</p>

<ul>
<li>Table 1 has 1 unique column</li>
<li>Table 2 has 2 columns to find a unique row</li>
<li>Table 3 has 3 columns to find a unique row</li>
</ul>

<p>I would like my function to search the number of given arguments for the columns. But I don't quite know how.</p>

<p>I was thinking of passing a array <code>{"Value1", "Value2", "Value3"}</code></p>

<p>But how can I check based on the number of arguments if the row matches?</p>

<p>I was thinking somthing like this, but maybe there is a better solution to this problem?</p>

<pre><code>Private Function FindRow(ByVal StringArray As String()) As Integer
    Dim NumberOfArguments As Integer = oStringArray.Length
    Dim MatchesCount As Integer = 0

    For i = 0 as integer to rows.count

        For x = 0 as integer to columns.count
            For y = 0 as integer to NumberOfArguments
                If Row(i).Column(x).value = StringArray(y) Then
                    MatchesCount += 1
                End If
            Next
        Next

        If MatchesCount = NumberOfArguments Then
            FindRow = i
        End If
    Next
End Function
</code></pre>