Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [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
- cmdMySQL.CommandText = "select * from core_members where `email` = @Login";
- cmdMySQL.Parameters.AddWithValue("@Login", Login );
Add Comment
Please, Sign In to add comment