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; }
public DBManager(DataBase.DataBaseType nType, string nConnectionString) { InitializeConnection(nType, nConnectionString); InitializeSchemaMaping(); DataBase.IsInheritDataBase = false; }
public DBManager(DataBase.DataBaseType nType, string nConnectionString, DBManager nInheritDbManager) { InitializeConnection(nType, nConnectionString); InitializeSchemaMaping(); LinkDataBaseManager(nInheritDbManager); }
private void InitializeConnection(DataBase.DataBaseType nType, string nConnectionString) { this._DataBase = DataBaseFactory.CreateDatabase(nType, nConnectionString); this._IsRemoting = (DataBaseFactory.GetRemotingUrl(nConnectionString) != ""); this._IsTrusted = DataBaseFactory.GetRemotingTrusted(nConnectionString); }