0
I’m having a hard time getting Rows.
It recognizes no variable within the cmdMySQL
(@Login
). I tried to put other but nothing if I take the @Login
and put the value of email
who is in the comic book he thinks normally.
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
}