title: Dataview Rowfilter
body: <p>I have a textbox and a button. What i am attempting to do is filter a gridview with the data that has been searched for. The two fields im searching for are customerID and CustomerName.</p>
  
  <p>My code:</p>
  
  <pre><code>Dim GetAllCusts As New BusinessLayer.Customer
  Dim dt As DataTable = GetAllCusts.GetCustomers 
  Dim dv As New DataView(dt)
  
  dv.RowFilter = String.Format("CustomerID='{0}' Or CustomerName='{0}'", SearchTextbox.Text) 
  
  gridview1.DataSource = dv
  gridview1.DataBind()
  </code></pre>
  
  <p>When searching for a customer id everything works. When searching for a customer name i get "Cannot perform '=' operation on System.Int32 and System.String.".</p>
  
  <p>I tried to CONVERT(CustomerName, System.String) but that didnt resolve however i think this was leading me away from the initial problem as i started to guess around.</p>
  
  <p>I would like to have one textbox to search for a customer id and customer name. What is wrong with the RowFilter and how could it be resolved?</p>
  
  <p>Thanks</p>