Esempio n. 1
0
        public bool CreateDataBase(DataBaseType nType, string nConnectionString, byte[] nRemotingPassword, out DataBase nDataBase, out string nMessage)
        {
            nMessage = "";
            nDataBase = null;

            try
            {
                if (this.ServerPassword == Crypto.RSADecryptText(nRemotingPassword, this.ServerPrivateKey))
                {
                    nDataBase = DataBaseFactory.CreateDatabase(nType, DataBaseFactory.GetInnerConnectionString(nConnectionString));

                    nDataBase._proxy = this;

                    this._DataBaseList.Add(nDataBase._token, nDataBase);

                    return true;
                }
                else
                {
                    throw new Exception("La contraseña de acceso al servidor remoting no es válida");
                }
            }
            catch (Exception ex)
            {
                nMessage = ex.Message;
            }

            return false;
        }
Esempio n. 2
0
 public DBManager(DataBase.DataBaseType nType, string nConnectionString)
 {
     InitializeConnection(nType, nConnectionString);
     InitializeSchemaMaping();
     DataBase.IsInheritDataBase = false;
 }
Esempio n. 3
0
 public DBManager(DataBase.DataBaseType nType, string nConnectionString, DBManager nInheritDbManager)
 {
     InitializeConnection(nType, nConnectionString);
     InitializeSchemaMaping();
     LinkDataBaseManager(nInheritDbManager);
 }
Esempio n. 4
0
 private void InitializeConnection(DataBase.DataBaseType nType, string nConnectionString)
 {
     this._DataBase = DataBaseFactory.CreateDatabase(nType, nConnectionString);
     this._IsRemoting = (DataBaseFactory.GetRemotingUrl(nConnectionString) != "");
     this._IsTrusted = DataBaseFactory.GetRemotingTrusted(nConnectionString);
 }