I'm having trouble getting the rows .
It does not recognize any variables within cmdMySQL
( @Login
). I tried to put others but nothing if I take the @Login
and put the value of email
that is in the BD he usually thinks.
My code:
[WebMethod]
public int connectoToMySql()
{
string Login = "emaildeteste";
string Pass = "umasenhaforteai";
string connString = "SERVER=local" + ";" +
"DATABASE=admin;" +
"UID=root;" +
"PASSWORD=*******;" +
"Allow User Variables = True;";
MySqlConnection cnMySQL = new MySqlConnection(connString);
MySqlCommand cmdMySQL = cnMySQL.CreateCommand();
MySqlDataReader reader;
cmdMySQL.CommandText = "select * from core_members where 'email' = @Login";
cnMySQL.Open();
reader = cmdMySQL.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(reader);
cnMySQL.Close();
if (dt.Rows.Count > 0)
{
return 1;
Console.WriteLine("Pegou a ROW");
}
return 50; //so testando
}