Try to parameterize this code.
string sql = "SELECT COUNT(*) AS count FROM users WHERE username ='" + username + "' AND password='"+ password + "';";
MySqlCommand cmd = new MySqlCommand(sql, conn);
MySqlDataReader rdr = cmd.ExecuteReader();