string connectionString = GetConnectionString(); using (SQLiteConnection connection = new SQLiteConnection(connectionString)) { connection.Open(); SQLiteTransaction transaction = connection.BeginTransaction(); SQLiteCommand newCommand = connection.CreateCommand(); try { newCommand.CommandText = string.Format("UPDATE {0} SET MainVersion = {1}, CurrentVersion = {2}", "Version", (serverCurrentVersion - 1), (serverCurrentVersion + 1)); newCommand.ExecuteNonQuery(); newCommand.CommandText = string.Format("UPDATE {0} SET AppVersion = {1} WHERE AppVersion = {2}", "QueryTable", serverCurrentVersion + 1, serverCurrentVersion); newCommand.ExecuteNonQuery(); newCommand.CommandText = string.Format("UPDATE {0} SET AppVersion = {1} WHERE AppVersion = {2}", "IndexQueryTable", serverCurrentVersion + 1, serverCurrentVersion); newCommand.ExecuteNonQuery(); transaction.Commit(); status = true; } catch (Exception ex) { transaction.Rollback(); } finally { newCommand.Dispose(); transaction.Dispose(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)