diff --git a/Saviour Backup System/databaseTools.cs b/Saviour Backup System/databaseTools.cs index f5f3c1e..f0f5eb1 100644 --- a/Saviour Backup System/databaseTools.cs +++ b/Saviour Backup System/databaseTools.cs @@ -180,5 +180,28 @@ namespace Saviour_Backup_System return table; } } + + public static void updateDriveRecord(string backupName, string backupLocation, bool automatic, bool compression, int previousBackups, Int64 creationDate) + {; + conn.Open(); + cmd.CommandText = "UPDATE Recordset SET Name=?, Backup_Location=?, Automatic=?, Compression=?, Previous_Backups=? WHERE Creation_Date=?;"; + cmd.Parameters.Add(new SqlCeParameter("Backup Name", SqlDbType.NText)); + cmd.Parameters.Add(new SqlCeParameter("Backup Location", SqlDbType.NText)); + cmd.Parameters.Add(new SqlCeParameter("Automatic", SqlDbType.Bit)); + cmd.Parameters.Add(new SqlCeParameter("Compression", SqlDbType.Bit)); + cmd.Parameters.Add(new SqlCeParameter("Previous Backups", SqlDbType.Int)); + cmd.Parameters.Add(new SqlCeParameter("Creation Date", SqlDbType.BigInt)); + + cmd.Parameters["Backup Name"].Value = backupName; + cmd.Parameters["Backup Location"].Value = backupLocation; + cmd.Parameters["Automatic"].Value = automatic; + cmd.Parameters["Compression"].Value = compression; + cmd.Parameters["Previous Backups"].Value = previousBackups; + cmd.Parameters["Creation Date"].Value = creationDate; + + cmd.ExecuteNonQuery(); + cmd.Parameters.Clear(); + conn.Close(); + } } }