title: mysql syntax error while using select query
body: <p>I am getting this error when im using this command</p>
  
  <pre><code>MySqlCommand cmdDataBase = new MySqlCommand("select * from employee.transaction where department = '" + this.department.Text + "', month = '" + this.dateTimePicker1.Value.Month.ToString() + "' and year = '" + this.dateTimePicker1.Value.Year.ToString() + "' ;", conDataBase);
  </code></pre>
  
  <p>error :- you have an error in your sql syntax;check the manual that corresponds to your mysql server version for the right syntax to use near ' month = '7' and year = '2015" at line 1</p>
  
  <p>month and year are of type Int in my table in mysql(version 5.6.25)</p>
  
  <p>Can anyone help ?</p>