title: "Cannot perform '=' operation on System.Int32 and System.String" while performing a search
body: <p>Trying to search through a DataList, with the parameters being movie genres (loaded through a database, so no switch case) and a name</p>
  
  <pre><code>protected void ButtonFilter_Click(object sender, EventArgs e)
      {
          string filter = "";
          int selectedCount = 0;
          for (int i = 0; i &lt; this.CheckBoxListGenres.Items.Count; i++)
              if (this.CheckBoxListGenres.Items[i].Selected)
                  selectedCount++;
          if (selectedCount &gt; 0)
          {
              filter = "GenreID=";
              int n = 0; //Used to determine to which genre the loop has arrived
              for (int i = 0; i &lt; this.CheckBoxListGenres.Items.Count; i++)
              {
                  if (this.CheckBoxListGenres.Items[i].Selected)
                  {
                      if (n &gt; 0 &amp;&amp; n &lt; selectedCount)
                          filter += " AND ";
                      filter+="'*"+this.CheckBoxListGenres.Items[i].Value.ToString()+"*'";
                      n++;
  
                  }
              }
  
              if (this.TextBoxMovieName.Text!="")
                  filter += " AND MovieName LIKE '*" + this.TextBoxMovieName.Text + "*'";
              DataTable dataTable = ((DataSet)Application["DataSetMovies"]).Tables[0];
              DataView dataView = new DataView(dataTable);
              filter = Convert.ToString(filter);
              dataView.RowFilter = filter; //!Getting the error here!
              this.DataListMovies.DataSource = dataView;
              this.DataListMovies.DataBind();
          }
      }
  </code></pre>
  
  <p>Tried debugging, the string itself seems fine, so I tried using Convert.ToString() on filter, just to make sure but it doesn't matter.
  Help?</p>
  
  <p>Thanks in advance</p>