Beispiel #1
0
 /// <summary>
 /// setup a new database with all tables
 /// </summary>
 public static void FirstUse()
 {
     Context.DataContext dbContext = new Context.DataContext(EstablishValidConnection());
     if (!(dbContext.DatabaseExists()))
     {
         dbContext.CreateDatabase();
     }
     else
     {
         //ClearData();
     }
     //DropInitDB();
 }
Beispiel #2
0
        private static void DropInitDB()
        {
            //RunScript("schemaInit.sql");

            Context.DataContext dbContext = new Context.DataContext(EstablishValidConnection());
            if (!(dbContext.DatabaseExists()))
            {
                dbContext.CreateDatabase();
            }
            else
            {
                ClearData();
            }

            RunScript("dataInit.sql");
        }