title: Conversion failed when converting the varchar value
body: <p>When I try to run this, it gives me the following error message:</p>
  
  <blockquote>
    <p>Conversion failed when converting the varchar value 'category_id' to data type int.</p>
  </blockquote>
  
  <p>Here's my SQL and parameter code, I supposed it should work, but it doesn't.</p>
  
  <pre><code>mycmd.CommandText="SELECT * FROM categories WHERE @db_property = @property_id"; 
  
  // This contains a string "category_id", which is correct.
  mycmd.Parameters.Add("@db_property", SqlDbType.VarChar).Value=db_property_field; 
  
  // This contains an Int, referring to the category_id in database. As of now, this is 1
  mycmd.Parameters.Add("@property_id", SqlDbType.Int).Value=property_id; 
  </code></pre>
  
  <p>After I'm going through this code, I run it through a Reader, and that's where I get the error message above. Been asking teacher, and excellent students in my class, no one can find a clue on, where the problem is. </p>