Ejemplo n.º 1
0
        public void CreateDatabase(string context)
        {
            AccessTools.CreateDatabase("TestDatabase", deleteIfExists: true);
            Assert.IsTrue(File.Exists("TestDatabase.mdb"));

            using (var db = new DataConnection(AccessTools.GetDataProvider(), "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TestDatabase.mdb;Locale Identifier=1033;Jet OLEDB:Engine Type=5;Persist Security Info=True"))
            {
                db.CreateTable <SqlCeTests.CreateTableTest>();
                db.DropTable <SqlCeTests.CreateTableTest>();
            }

            AccessTools.DropDatabase("TestDatabase");
            Assert.IsFalse(File.Exists("TestDatabase.mdb"));
        }
 /// <summary>
 /// Configure connection to use Access OleDb provider and connection string.
 /// </summary>
 /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param>
 /// <param name="connectionString">Access connection string.</param>
 /// <returns>The builder instance so calls can be chained.</returns>
 public static LinqToDbConnectionOptionsBuilder UseAccessOleDb(this LinqToDbConnectionOptionsBuilder builder, string connectionString)
 {
     return(builder.UseConnectionString(AccessTools.GetDataProvider(null), connectionString));
 }