title: Operator == cannot be applied to operands of type string and int
body: <p>So i have winform in which i have a datagrid with information in it and i want to search in it however i want the criteria of the search to be Year(int) of the product and its Type(string).</p>
  
  <pre><code>products[] a = new products[productscopy.Count];
  int type = int.Parse(textBox2.Text);
  int year = int.Parse(textBox1.Text);
  
  int br = 0;
  foreach (products sl in productscopy)
  {
      if (sl.Year == year &amp;&amp; sl.Type == type) //line that causes problem
      {
          a[br] = sl; br++;
      }
  }
  if (br &gt; 0)
  {
      products[] b = new products[br];
      for (int i = 0; i &lt; br; i++)
      {
          b[i] = a[i];
      }
      dataGridView1.DataSource = b;
      dataGridView1[0, 0].Selected = false;
  }
  else { dataGridView1.DataSource = null; }
  </code></pre>