Ejemplo n.º 1
0
        public Service1()
        {
            InitializeComponent();

            this.BDD = ConnexionSql.getInstance("localhost", "gsb", "root", "");

            BDD.openConnection();
        }
Ejemplo n.º 2
0
 /**
  * méthode de création d'une instance de connexion si elle n'existe pas (singleton)
  */
 public static ConnexionSql getInstance(string unProvider, string uneDataBase, string unUid, string unMdp)
 {
     lock ((mylock))
     {
         try
         {
             if (null == connection)
             { // Premier appel
                 connection = new ConnexionSql(unProvider, uneDataBase, unUid, unMdp);
             }
         }
         catch (Exception emp)
         {
             throw (emp);
         }
         return(connection);
     }
 }