Ejemplo n.º 1
0
 //Delete all contactlist or delete Contacts table
 public void DeleteAllContact()
 {
     using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         conn.DropTable <Contacts>();
         conn.CreateTable <Contacts>();
         conn.Dispose();
         conn.Close();
     }
 }
Ejemplo n.º 2
0
 private static void ExcluirTodasGastoCnpj()
 {
     using (SQLite.Net.SQLiteConnection conexao = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         conexao.DropTable <GastoCnpj>();
         conexao.CreateTable <GastoCnpj>();
         conexao.Dispose();
         conexao.Close();
     }
 }
Ejemplo n.º 3
0
 private static void ExcluirTodosOsDeputados()
 {
     using (SQLite.Net.SQLiteConnection conexao = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         for (int i = 0; i <= 10; i++)
         {
             try
             {
                 conexao.DropTable <Deputado>();
                 conexao.CreateTable <Deputado>();
                 conexao.Dispose();
                 conexao.Close();
                 break;
             }
             catch
             {
                 Task.Delay(5000);
                 break;
             }
         }
     }
 }
Ejemplo n.º 4
0
 // Close database connection
 private void closeDBconnection()
 {
     conn.Commit();
     conn.Dispose();
     conn.Close();
 }