Exemple #1
0
        public OleDbDatabase(string provider, string dataSource, string connectionName)
            : base()
        {
            if (!Path.GetExtension(dataSource).Equals(".accdb"))
            {
                dataSource = $"{dataSource}.accdb";
            }
            FileInfo db = new FileInfo(dataSource);

            if (!db.Exists)
            {
                CreateAccessFile(db.FullName);
            }
            ConnectionStringResolver = new OleDbConnectionStringResolver(provider, dataSource);
            ConnectionName           = connectionName;
            Register();
        }
Exemple #2
0
 public OleDbDatabase(OleDbConnectionStringResolver connectionStringResolver)
 {
     ConnectionName           = connectionStringResolver.ConnectionName;
     ConnectionStringResolver = connectionStringResolver;
     Register();
 }