private static void DeleteAllTables(OfflineDatabase db) { const int maxTableCount = 100; var command = db.CreateCommand("SELECT name FROM sqlite_master WHERE type = 'table'"); var tables = command.ExecuteQuery(maxTableCount) .Select(r => r.Count > 0 ? r[0].ToString() : null) .Where(n => !string.IsNullOrWhiteSpace(n)) .ToList(); foreach (var table in tables) { var dropQuery = "DROP TABLE IF EXISTS " + table; db.Execute(dropQuery); } }