i develop a simple wcf application which connect with the mysql database when i try to get data from database with some condition it shows error .
Select query is:
string password = "123456";
string email = "pushpam@gmail.com"
openDatabase();
string query = "select email,password from BloobBank.bloodTable where email = "+email+" and password = "+password+";";
MySqlCommand cmd = new MySqlCommand(query, connection);
MySqlDataReader mysqlreader = cmd.ExecuteReader();// this line gives error.
Error:
An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll but was not handled in user code
Additional information: 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 '@gmail.com and password = 123456' at line 1