Ejemplo n.º 1
0
        /// <summary>
        /// Create connection to database, by default
        /// </summary>
        /// <param name="pDataBaseFactoryType"></param>
        /// <param name="connectionString"></param>
        /// <returns>IDataBaseAccess</returns>
        public IDataBaseAccess GetDataBaseAccess(DataBaseFactoryType pDataBaseFactoryType, string connectionString)
        {
            switch (pDataBaseFactoryType)
            {
            case DataBaseFactoryType.SQLServer:
                _dataBase = new SQLServerDataBaseAccess();
                break;

            default:
                _dataBase = new SQLServerDataBaseAccess();
                break;
            }

            _dataBase.ConnectionString = connectionString;

            return(_dataBase);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create connection to database, by default
        /// </summary>
        /// <param name="pDataBaseFactoryType"></param>
        /// <param name="connectionString"></param>
        /// <returns>IDataBaseAccess</returns>
        public IDataBaseAccess GetDataBaseAccess( DataBaseFactoryType pDataBaseFactoryType , string connectionString )
        {
            switch( pDataBaseFactoryType )
            {
                case DataBaseFactoryType.SQLServer:
                    _dataBase = new SQLServerDataBaseAccess();
                    break;

                default:
                    _dataBase = new SQLServerDataBaseAccess();
                    break;
            }

            _dataBase.ConnectionString = connectionString;

            return _dataBase;
        }