public MySqlDataReader LecturetoutCategories()
        {
            try
            {
                string bddServeur = ConfigurationManager.AppSettings["serveur"];
                string sBddPort   = ConfigurationManager.AppSettings["port"];
                int    bddPort    = Convert.ToInt16(sBddPort);
                string bddBase    = ConfigurationManager.AppSettings["base"];
                string bddIdent   = ConfigurationManager.AppSettings["identificateur"];
                string bddMdp     = ConfigurationManager.AppSettings["mdp"];

                Connex = new Dbconnect(bddServeur, bddPort, bddBase, bddIdent, bddMdp);

                if (Connex.OuvrirConnexion())
                {
                    string requete = "SELECT * FROM categorie";
                    reader = Connex.RequeteSql(requete);
                    return(reader);
                }
            }
            catch
            {
                return(reader);
            }
            Connex.FermerConnexion();
            return(reader);
        }
Beispiel #2
0
        public MySqlDataReader LectureunInscrit(Int32 NumTranspondeur)
        {
            try
            {
                string bddServeur = ConfigurationManager.AppSettings["serveur"];
                string sBddPort   = ConfigurationManager.AppSettings["port"];
                int    bddPort    = Convert.ToInt16(sBddPort);
                string bddBase    = ConfigurationManager.AppSettings["base"];
                string bddIdent   = ConfigurationManager.AppSettings["identificateur"];
                string bddMdp     = ConfigurationManager.AppSettings["mdp"];

                Connex = new Dbconnect(bddServeur, bddPort, bddBase, bddIdent, bddMdp);

                if (Connex.OuvrirConnexion())
                {
                    string requete = "SELECT * FROM inscription WHERE transpondeur_IdTranspondeur = " + NumTranspondeur;

                    reader = Connex.RequeteSql(requete);
                    return(reader);
                }
                else
                {
                    return(reader);
                }
            }
            catch
            {
                Connex.FermerConnexion();
                return(reader);
            }
        }