title: Search for names in the database that matches whole parameters or any part of parameters
body: <blockquote>
    <p>C# or VB.NET are welcome.</p>
  </blockquote>
  
  <p>I'm writing a query to select all records that has any part of parameter.</p>
  
  <p>I have one table called Employees. Some people have name like this: John David Clark</p>
  
  <p>If the parameter is</p>
  
  <ul>
  <li>"John"</li>
  <li>"John David"</li>
  <li>"David John"</li>
  <li>"John Clark"</li>
  <li>"Clark John"</li>
  </ul>
  
  <p>I should be able to get result back as long as there's a match in the parameters.</p>
  
  <p>If I use Function Contains (q.FirstName &amp; " " &amp; q.LastName).Contains(employeeName), I will not get any result back if employeeName is "John Clark"
  Function Contains looks only for next words from left to right. It doesn't match a single word at a time. </p>
  
  <p>So that's why I used this in the Linq to SQL:</p>
  
  <pre><code>        Dim employeeName As String
          query = From q In db.Employees _
                  Where (q.FirstName &amp; " " &amp; q.LastName).Split(CChar(" ")).Intersect(employeeName.Split(CChar(" "))).Any _
                  Select q
  </code></pre>
  
  <p>I got the following error: </p>
  
  <blockquote>
    <p>Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains() operator</p>
  </blockquote>
  
  <p>Is there another way that I can query for FirstName and LastName that has any part of parameter ?</p>