Exemplo n.º 1
0
        public DBtools(AdoHelper Ahlp, string Adbcon)
        {
            //
            // TODO: Add constructor logic here
            //
            dbhelper = Ahlp;
            dbcon = Adbcon;
            con = dbhelper.GetConnection(dbcon);

            // begin transaction here
        }
Exemplo n.º 2
0
Arquivo: User.cs Projeto: oeli/yafra
        public void SetLogin(string Auser, string Apwd, string Adbname, string Adbtype, string Adbhost)
        {
            // update Userprofile class with login data and create ADO.NET connection string
            Uname = String.Copy(Auser);
            Upwd = String.Copy(Apwd);
            Udbname = String.Copy(Adbname);
            Udbtype = String.Copy(Adbtype);
            Udbhost = String.Copy(Adbhost);

            if (Adbtype == "Oracle")
                Udbcon = String.Format("Data Source={0};user id={1};pwd={2}", Udbname, Uname, Upwd);
            else
                Udbcon = String.Format("Data Source={0};Initial catalog={1};user id={2};pwd={3}", Udbhost, Udbname, Uname, Upwd);
            Uadostr = String.Format("org.swyn.foundation.db.{0}", Udbtype);
            Uhelper = AdoHelper.CreateHelper("org.swyn.foundation", Uadostr);
            // check if Uhelper is null and raise error event
        }