/// <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; }
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; }
/// <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; }
/// <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; }
public AccessDataSource WithSettings(AccessDataSourceSettings settings) { var mergedSettings = new AccessDataSourceSettings() { DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout, SuppressGlobalEvents = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents, StrictMode = settings?.StrictMode ?? StrictMode }; var result = new AccessDataSource(Name, m_ConnectionBuilder, mergedSettings, m_DatabaseMetadata, m_Cache, m_ExtensionCache); result.m_DatabaseMetadata = m_DatabaseMetadata; result.AuditRules = AuditRules; result.UserValue = UserValue; result.ExecutionStarted += (sender, e) => OnExecutionStarted(e); result.ExecutionFinished += (sender, e) => OnExecutionFinished(e); result.ExecutionError += (sender, e) => OnExecutionError(e); result.ExecutionCanceled += (sender, e) => OnExecutionCanceled(e); return(result); }
/// <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; }
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; }
/// <summary> /// Initializes a new instance of the <see cref="AccessDataSource" /> class. /// </summary> /// <param name="connectionString"></param> /// <param name="settings">Optional settings object.</param> public AccessDataSource(string connectionString, AccessDataSourceSettings settings = null) : this(null, connectionString, settings) { }
/// <summary> /// Initializes a new instance of the <see cref="AccessDataSource" /> class. /// </summary> /// <param name="connectionStringBuilder"></param> /// <param name="settings">Optional settings object.</param> public AccessDataSource(OleDbConnectionStringBuilder connectionStringBuilder, AccessDataSourceSettings settings = null) : this(null, connectionStringBuilder, settings) { }
/// <summary> /// Initializes a new instance of the <see cref="AccessDataSource" /> class. /// </summary> /// <param name="connectionString"></param> /// <param name="settings">Optional settings object.</param> public AccessDataSource(string connectionString, AccessDataSourceSettings settings = null) : this(null, connectionString, settings) { }
public AccessDataSource WithSettings(AccessDataSourceSettings settings) { var mergedSettings = new AccessDataSourceSettings() { DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout, SuppressGlobalEvents = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents, StrictMode = settings?.StrictMode ?? StrictMode }; var result = new AccessDataSource(Name, m_ConnectionBuilder, mergedSettings, m_DatabaseMetadata, m_Cache, m_ExtensionCache); result.m_DatabaseMetadata = m_DatabaseMetadata; result.AuditRules = AuditRules; result.UserValue = UserValue; result.ExecutionStarted += (sender, e) => OnExecutionStarted(e); result.ExecutionFinished += (sender, e) => OnExecutionFinished(e); result.ExecutionError += (sender, e) => OnExecutionError(e); result.ExecutionCanceled += (sender, e) => OnExecutionCanceled(e); return result; }
/// <summary> /// Initializes a new instance of the <see cref="AccessDataSource" /> class. /// </summary> /// <param name="connectionStringBuilder"></param> /// <param name="settings">Optional settings object.</param> public AccessDataSource(OleDbConnectionStringBuilder connectionStringBuilder, AccessDataSourceSettings settings = null) : this(null, connectionStringBuilder, settings) { }