We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried to use the following construct and expected that the connectionString will contain a Jet OLEDB:Database Password-section
Jet OLEDB:Database Password
JetDriverConfiguration.Standard.ConnectionString(arg => arg.DatabaseFile("foo") .Password("foo"));
This was not the case, so I've implemented two classes to extend the JetDriverConfiguration-scenario by replacing it like so:
JetDriverConfiguration
public sealed class AccessConnectionStringBuilder : ConnectionStringBuilder { private string databaseFile; private string databasePassword; private string password; private string provider; private string username; public AccessConnectionStringBuilder() { this.provider = "Microsoft.Jet.OLEDB.4.0"; } public AccessConnectionStringBuilder Provider(string provider) { this.provider = provider; this.IsDirty = true; return this; } public AccessConnectionStringBuilder DatabaseFile(string databaseFile) { this.databaseFile = databaseFile; this.IsDirty = true; return this; } public AccessConnectionStringBuilder Username(string username) { this.username = username; this.IsDirty = true; return this; } public AccessConnectionStringBuilder Password(string password) { this.password = password; this.IsDirty = true; return this; } public AccessConnectionStringBuilder DatabasePassword(string databasePassword) { this.databasePassword = databasePassword; this.IsDirty = true; return this; } protected override string Create() { var str = base.Create(); if (!string.IsNullOrEmpty(str)) { return str; } var stringBuilder = new StringBuilder(); if (!string.IsNullOrEmpty(this.databasePassword)) { stringBuilder.AppendFormat("Provider={0};Data Source={1};Jet OLEDB:Database Password={2};", this.provider, this.databaseFile, this.databasePassword); } else if (!string.IsNullOrEmpty(this.password)) { stringBuilder.AppendFormat("Provider={0};Data Source={1};User Id={2};Password={3};", this.provider, this.databaseFile, this.username, this.password); } else { stringBuilder.AppendFormat("Provider={0};Data Source={1}", this.provider, this.databaseFile); } return stringBuilder.ToString(); } } public class AccessDriverConfiguration : PersistenceConfiguration<AccessDriverConfiguration, AccessConnectionStringBuilder> { protected AccessDriverConfiguration() { this.Dialect<JetDialect>(); this.Driver<JetDriver>(); } public static AccessDriverConfiguration Standard { get { return new AccessDriverConfiguration(); } } }
Is this a legit replacement, or is there anything alike in your library?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I tried to use the following construct and expected that the connectionString will contain a
Jet OLEDB:Database Password
-sectionThis was not the case, so I've implemented two classes to extend the
JetDriverConfiguration
-scenario by replacing it like so:Is this a legit replacement, or is there anything alike in your library?
The text was updated successfully, but these errors were encountered: