I want to compare the email with the parameter variable also called email. I am getting an error saying "Parameter ?email must be defined" I also tried using @email:
internal bool ValidateUser(string email, string password, bool rememberMe)
{
bool valid = false;
using (_msqlCon = new MySqlConnection(_connectionString))
{
_msqlCon.Open();
_query = "SELECT Password, RememberMe FROM RegisteredUsers WHERE Email = ?email";
using (_command = new MySqlCommand(_query, _msqlCon))
{
MySqlDataReader reader = _command.ExecuteReader();
if (reader["Password"].Equals(password)) { valid = true; }
}
}
return valid;
}
How can I check if the column Email is the same as the one given as parameter?