title: Cannot perform 'Like' operation on System.Decimal and System.String
body: <p>I want to use a filter on my datagridview according to the below method:</p>
  
  <pre><code> dt = ExecuteSelect(QueryCondition, IDWindow).Tables(0)
          _textFilters = ""
  
              Dim first As Boolean = True
  
              For Each f As field In fields
                  If f.Value.Length &gt; 0 Then
  
                      If Not first Then
                          _textFilters += " and "
                      End If
                  _textFilters &amp;=  f.Field &amp;  " like '%" &amp; f.Value &amp; "%'"
                      first = False
                  End If
          Next
  
          dt.DefaultView.RowFilter = _textFilters
  </code></pre>
  
  <p>I got the error in the line </p>
  
  <pre><code> dt.DefaultView.RowFilter = _textFilters
  </code></pre>
  
  <p>Cannot perform 'Like' operation on System.Decimal and System.String</p>
  
  <p>because i have some decimal fields in my database table.</p>
  
  <p>But if i use:</p>
  
  <pre><code> Dim view As DataView = New DataView(grille.DataSource)
  _textFilters = ""
  Dim first As Boolean = True
   For Each f As field In fields
                  If f.Value.Length &gt; 0 Then
                  If Not first Then
                      _textFilters += " and "
                  End If
                  Select Case f.Field.GetType.ToString
                      Case "String"
                          _textFilters &amp;= f.Field &amp; " like '%" &amp; f.Value &amp; "%'"
                      Case "DateTime"
                      Case Else
                          _textFilters &amp;= f.Field &amp; "&gt;=" &amp; f.Value
                  End Select
  
                      first = False
                  End If
          Next
  
          view.RowFilter = _textFilters
  </code></pre>
  
  <p>The code doesnt send an error but the filter doesn't work .</p>
  
  <p>Hope I'm clear</p>
  
  <p>Thanks in advance</p>