コード例 #1
0
ファイル: OracleQuerySession.cs プロジェクト: hankuikuide/Fm
        public OracleQuerySession(DatabaseInfo databaseInfo)
        {
            this.databaseInfo = databaseInfo;

            this.dbParameterCreater = new DbParameterCreater();
            #region "连接字符串解密"


            //苗建龙 修改
            //var connectionStrings = ConfigurationManager.ConnectionStrings["shenHeDb"].ConnectionString;
            var connectionStrings = ConfigHelper.Instance.Get(databaseInfo.ConnectionStringName)
                                    ?? ConfigHelper.Instance.GetSection("DBConnectionString")[databaseInfo.ConnectionStringName];
            //var connectionStrings = ConfigurationManager.AppSettings["shenHeDb"].ToString();

            var connStr = new Infrastructure.SymmetricMethod().Decrypto(connectionStrings);
            if (!string.IsNullOrEmpty(connStr))
            {
                connectionString = connStr;
            }
            else
            {
                connectionString = connectionStrings;
            }

            //dbProviderFactory = DbProviderFactories.GetFactory("Oracle.ManagedDataAccess.Client");
            #endregion

            this.sqlLog = new SqlLog(databaseInfo);
        }
コード例 #2
0
        public MySqlQuerySession(DatabaseInfo databaseInfo)
        {
            this.databaseInfo = databaseInfo;

            this.dbParameterCreater = new DbParameterCreater();

            connectionString = ConfigHelper.Instance.Get(databaseInfo.ConnectionStringName) ??
                               ConfigHelper.Instance.GetSection("DBConnectionString")[databaseInfo.ConnectionStringName];

            this.sqlLog = new SqlLog(databaseInfo);
        }