public BaseDbActionService(ConnectInfo connectInfo)
        {
            this.paramterInfo  = null;
            this.disposedValue = false;

            this.connectInfo = connectInfo;
            this.InitConnection();
        }
 public BaseDbActionService(SqlDataBaseService.ConnectInfo connectInfo)
 {
     this.paramterInfo  = null;
     this.disposedValue = 0;
     base..ctor();
     this.connectInfo = connectInfo;
     this.InitConnection();
     return;
 }
Esempio n. 3
0
        /// <summary>
        /// 根据数据库类型创建数据库命令执行
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static DbCommand DbCommandFactory(ConnectInfo info)
        {
            DbCommand command = null;

            switch (info.BaseType)
            {
            case DataBaseType.SQL_LITER:
                command = new SQLiteCommand();
                break;

            case DataBaseType.SQL_MY_SQL:
                command = new MySqlCommand();
                break;

            case DataBaseType.SQL_SERVER:
                command = new SqlCommand();
                break;

            case DataBaseType.SQL_ORACLE:
                command = new  OracleCommand();
                break;
            }
            return(command);
        }
Esempio n. 4
0
        /// <summary>
        /// 数据库连接对象创建
        /// </summary>
        /// <param name="connectinfo"></param>
        /// <returns></returns>
        public static DbConnection ConnectionFactory(ConnectInfo connectinfo)
        {
            DbConnection connection = null;

            switch (connectinfo.BaseType)
            {
            case DataBaseType.SQL_LITER:
                connection = baseDBExecute.CreateSQLConnect <SQLiteConnection>(connectinfo.ConnectString);
                break;

            case DataBaseType.SQL_MY_SQL:
                connection = baseDBExecute.CreateSQLConnect <MySqlConnection>(connectinfo.ConnectString);
                break;

            case DataBaseType.SQL_ORACLE:
                connection = baseDBExecute.CreateSQLConnect <OracleConnection>(connectinfo.ConnectString);
                break;

            default:
                connection = baseDBExecute.CreateSQLConnect <SqlConnection>(connectinfo.ConnectString);
                break;
            }
            return(connection);
        }
Esempio n. 5
0
 public SQLiterDbAction(SqlDataBaseService.ConnectInfo connectInfo)
 {
     base..ctor(connectInfo);
     return;
 }
Esempio n. 6
0
 /// <summary>
 /// 获取当前管理中的数据库连接操作对象
 /// </summary>
 /// <param name="connectInfo"></param>
 /// <returns></returns>
 private ConnectInfo GetConnectInfo(ConnectInfo connectInfo)
 {
     return(dictionary[connectInfo.ConnectName]);
 }
Esempio n. 7
0
 /// <summary>
 /// 判断当前数据库连接管理里是否存在连接
 /// </summary>
 /// <param name="connectInfo"></param>
 /// <returns></returns>
 private bool HasConnect(ConnectInfo connectInfo)
 {
     return(dictionary.ContainsKey(connectInfo.ConnectName));
 }