Tenho o seguinte código em minha aplicação: public Usuario checkLogin(Usuario entity) { //return Usuario userEntity = new Usuario(); connection = mysql.OpenConnection(); try { MySqlCommand stm = new MySqlCommand(); MySqlDataReader data; stm.CommandText = “CALL validaLogin(?login, ?senha)”; stm.Connection = connection; stm.Parameters.AddWithValue(“?login”, entity.Login); stm.Parameters.AddWithValue(“?senha”, entity.Senha); var id = stm.ExecuteScalar(); errorUtil.showCustomAlert(id.ToString()); } catch(MySqlException ex) { errorUtil.showDBError(ex); } finally{ connection.Close();Read more