title: System.Data.OleDb.OleDbException: Data type mismatch in criteria expression
body: <p>This is my code:</p>
  
  <pre><code>OleDbCommand Cmd = new OleDbCommand();
  Cmd.Connection = MyConn;
  Cmd.CommandText = "SELECT * FROM catalogue WHERE id = '" + questionid + "'";
  
  OleDbDataReader read = Cmd.ExecuteReader();
  
  int id = 0;
  
  while (read.Read())
  {
      id = Convert.ToInt32(read["id"]);
  }
  </code></pre>
  
  <p>Here's the error it gives me:</p>
  
  <pre><code>Line 27:         Cmd.CommandText = "SELECT * FROM catalogue WHERE id = '" + questionid + "'";
  Line 28: 
  Line 29:         OleDbDataReader read = Cmd.ExecuteReader(); // The error is here
  Line 30: 
  Line 31:         int id = 0;
  </code></pre>
  
  <p>I know there is also <a href="https://stackoverflow.com/questions/650282/oledbexception-data-type-mismatch-in-criteria-expression">another question about the same issue</a> on Stack Overflow, but it doesn't seem to solve my problem (it may solve yours, so I put a link).</p>