コード例 #1
0
 public static void CreateDatabaseIfNotExist()
 {
     if (!System.IO.File.Exists(IOVariables.databaseFile))
     {
         DLDatabase.CreateDatabase();
     }
     else
     {
         //great! the .db file exists. Now lets check if the user's .db file is up-to-date. let's see if the reminder table has all the required columns.
         if (DLDatabase.HasAllTables())
         {
             if (!DLDatabase.HasAllColumns())
             {
                 DLDatabase.InsertNewColumns(); //not up to date. insert !
             }
         }
         else
         {
             DLDatabase.InsertMissingTables();
             //re-run the method, since the .db file **should** now have all the tables.
             CreateDatabaseIfNotExist();
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Creates the database with associated tables
 /// </summary>
 public static void CreateDatabase()
 {
     DLDatabase.CreateDatabase();
 }