예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerDataSource" /> class.
        /// </summary>
        /// <param name="name">Optional 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 OleDbSqlServerDataSource(string name, OleDbConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings 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 OleDbSqlServerMetadataCache(m_ConnectionBuilder);

            if (settings != null)
            {
                XactAbort  = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }
            m_ExtensionCache = new ConcurrentDictionary <Type, object>();
            m_Cache          = DefaultCache;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OleDbSqlServerDataSource" /> class.
        /// </summary>
        /// <param name="name">Name of the data source.</param>
        /// <param name="connectionString">The connection string.</param>
        /// <param name="settings">Optional settings object.</param>
        /// <exception cref="ArgumentException">connectionString is null or empty.;connectionString</exception>
        public OleDbSqlServerDataSource(string?name, string connectionString, SqlServerDataSourceSettings?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 OleDbSqlServerMetadataCache(m_ConnectionBuilder);

            if (settings != null)
            {
                XactAbort  = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }

            m_ExtensionCache = new ConcurrentDictionary <Type, object>();
            m_Cache          = DefaultCache;
        }
예제 #3
0
        private OleDbSqlServerDataSource(string name, OleDbConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings, OleDbSqlServerMetadataCache 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;

            if (settings != null)
            {
                XactAbort  = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }
            m_ExtensionCache = extensionCache;
            m_Cache          = cache;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OleDbSqlServerDataSource" /> class.
        /// </summary>
        /// <param name="name">Name of the data source.</param>
        /// <param name="connectionString">The connection string.</param>
        /// <param name="settings">Optional settings object.</param>
        /// <exception cref="ArgumentException">connectionString is null or empty.;connectionString</exception>
        public OleDbSqlServerDataSource(string name, string connectionString, SqlServerDataSourceSettings settings = null) : base(settings)
        {
            if (string.IsNullOrEmpty(connectionString))
                throw new ArgumentException("connectionString is null or empty.", "connectionString");

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

            m_DatabaseMetadata = new OleDbSqlServerMetadataCache(m_ConnectionBuilder);

            if (settings != null)
            {
                XactAbort = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }

            m_ExtensionCache = new ConcurrentDictionary<Type, object>();
            m_Cache = DefaultCache;
        }
예제 #5
0
        private OleDbSqlServerDataSource(string name, OleDbConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings, OleDbSqlServerMetadataCache 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;

            if (settings != null)
            {
                XactAbort = settings.XactAbort;
                ArithAbort = settings.ArithAbort;
            }
            m_ExtensionCache = extensionCache;
            m_Cache = cache;
        }