Example #1
0
        private AccessDataSource(string name, OleDbConnectionStringBuilder connectionStringBuilder, AccessDataSourceSettings settings, AccessMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary<Type, object> extensionCache) : base(settings)
        {
            if (connectionStringBuilder == null)
                throw new ArgumentNullException("connectionStringBuilder", "connectionStringBuilder is null.");

            m_ConnectionBuilder = connectionStringBuilder;
            if (string.IsNullOrEmpty(name))
                Name = m_ConnectionBuilder.DataSource;
            else
                Name = name;

            m_DatabaseMetadata = databaseMetadata;
            m_ExtensionCache = extensionCache;
            m_Cache = cache;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AccessDataSource" /> class.
        /// </summary>
        /// <param name="name">The name of the data source.</param>
        /// <param name="connectionString">The connection string.</param>
        /// <param name="settings">Optional settings object.</param>
        /// <exception cref="ArgumentException">Connection string is null or emtpy.;connectionString</exception>
        public AccessDataSource(string name, string connectionString, AccessDataSourceSettings settings = null) : base(settings)
        {
            if (string.IsNullOrEmpty(connectionString))
                throw new ArgumentException("Connection string is null or emtpy.", "connectionString");

            m_ConnectionBuilder = new OleDbConnectionStringBuilder(connectionString);
            if (string.IsNullOrEmpty(name))
                Name = m_ConnectionBuilder.DataSource;
            else
                Name = name;

            m_DatabaseMetadata = new AccessMetadataCache(m_ConnectionBuilder);
            m_ExtensionCache = new ConcurrentDictionary<Type, object>();
            m_Cache = DefaultCache;
        }
Example #3
0
    /// <summary>
    /// Initializes a new instance of the <see cref="AccessDataSource" /> class.
    /// </summary>
    /// <param name="name">The name of the data source.</param>
    /// <param name="connectionStringBuilder">The connection string builder.</param>
    /// <param name="settings">Optional settings object.</param>
    /// <exception cref="ArgumentNullException">connectionStringBuilder;connectionStringBuilder is null.</exception>
    public AccessDataSource(string?name, OleDbConnectionStringBuilder connectionStringBuilder, AccessDataSourceSettings?settings = null) : base(settings)
    {
        m_ConnectionBuilder = connectionStringBuilder ?? throw new ArgumentNullException(nameof(connectionStringBuilder), $"{nameof(connectionStringBuilder)} is null.");

        if (string.IsNullOrEmpty(name))
        {
            Name = m_ConnectionBuilder.DataSource;
        }
        else
        {
            Name = name;
        }

        m_DatabaseMetadata = new AccessMetadataCache(m_ConnectionBuilder);
        m_ExtensionCache   = new ConcurrentDictionary <Type, object>();
        m_Cache            = DefaultCache;
    }
Example #4
0
    AccessDataSource(string?name, OleDbConnectionStringBuilder connectionStringBuilder, AccessDataSourceSettings?settings, AccessMetadataCache databaseMetadata, ICacheAdapter cache, ConcurrentDictionary <Type, object> extensionCache) : base(settings)
    {
        if (connectionStringBuilder == null)
        {
            throw new ArgumentNullException(nameof(connectionStringBuilder), $"{nameof(connectionStringBuilder)} is null.");
        }

        m_ConnectionBuilder = connectionStringBuilder;
        if (string.IsNullOrEmpty(name))
        {
            Name = m_ConnectionBuilder.DataSource;
        }
        else
        {
            Name = name;
        }

        m_DatabaseMetadata = databaseMetadata;
        m_ExtensionCache   = extensionCache;
        m_Cache            = cache;
    }
Example #5
0
    /// <summary>
    /// Initializes a new instance of the <see cref="AccessDataSource" /> class.
    /// </summary>
    /// <param name="name">The name of the data source.</param>
    /// <param name="connectionString">The connection string.</param>
    /// <param name="settings">Optional settings object.</param>
    /// <exception cref="ArgumentException">Connection string is null or empty.;connectionString</exception>
    public AccessDataSource(string?name, string connectionString, AccessDataSourceSettings?settings = null) : base(settings)
    {
        if (string.IsNullOrEmpty(connectionString))
        {
            throw new ArgumentException($"{nameof(connectionString)} is null or empty.", nameof(connectionString));
        }

        m_ConnectionBuilder = new OleDbConnectionStringBuilder(connectionString);
        if (string.IsNullOrEmpty(name))
        {
            Name = m_ConnectionBuilder.DataSource;
        }
        else
        {
            Name = name;
        }

        m_DatabaseMetadata = new AccessMetadataCache(m_ConnectionBuilder);
        m_ExtensionCache   = new ConcurrentDictionary <Type, object>();
        m_Cache            = DefaultCache;
    }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AccessDataSource" /> class.
        /// </summary>
        /// <param name="name">The name of the data source.</param>
        /// <param name="connectionStringBuilder">The connection string builder.</param>
        /// <param name="settings">Optional settings object.</param>
        /// <exception cref="ArgumentNullException">connectionStringBuilder;connectionStringBuilder is null.</exception>
        public AccessDataSource(string name, OleDbConnectionStringBuilder connectionStringBuilder, AccessDataSourceSettings settings = null) : base(settings)
        {
            if (connectionStringBuilder == null)
                throw new ArgumentNullException("connectionStringBuilder", "connectionStringBuilder is null.");

            m_ConnectionBuilder = connectionStringBuilder;
            if (string.IsNullOrEmpty(name))
                Name = m_ConnectionBuilder.DataSource;
            else
                Name = name;

            m_DatabaseMetadata = new AccessMetadataCache(m_ConnectionBuilder);
            m_ExtensionCache = new ConcurrentDictionary<Type, object>();
            m_Cache = DefaultCache;
        }