title: Multiple Where Parameters on EntityDataSource?
body: <p>I have a gridview that uses an entity datasource to populate itself. Depending on what the user has access to see, I want the gridview to implement a where clause. At the lowest level of access, the user can only see themselves. In order to do this I implement the line of code:</p>
  
  <pre><code>EmployeeEntityDataSource.Where = "it.Person_ID = " + selectQuery.ToString()
  </code></pre>
  
  <p>This successfully reduces the data in the gridview to the one appropriate user. If the user has the next step in access, they should be able to see themselves plus all the employees that work for them. I have sucessfully created a list of employees Person_IDs and I'm trying to filter my gridview so that if the Person_ID column in the gridview matches one of the Person_IDs in my list it should show up.</p>
  
  <p>I have tried the following bits of code:</p>
  
  <p>1.</p>
  
  <pre><code>For Each employeeID In employeeList
      If count2 &lt;&gt; count Then
          whereString += "it.Person_ID = " + employeeID.ToString() + " OR "
          count2 += 1
      Else
          whereString += "it.Person_ID = " + employeeID.ToString()
      End If
  Next
  
  EmployeeEntityDataSource.Where = whereString
  </code></pre>
  
  <p>Essentially thought I could create a giant where statement with a bunch of ORs but this did not work</p>
  
  <p>2.</p>
  
  <pre><code>EmployeeEntityDataSource.WhereParameters.Add(employeeList)
  EmployeeEntityDataSource.Where = "it.Person_ID = @employeeList"
  </code></pre>
  
  <p>The error I get here says a List(of T) cannot be converted WebControl.Parameter</p>
  
  <p>How do I properly create a WHERE statement that will compare the it.Person_ID of the gridview to each element in my list called employeeList?</p>