1
Fork 0

added database code to update form

This commit is contained in:
Jake Howard 2015-01-12 11:23:37 +00:00
parent 391d4485de
commit 51d11b2334

View file

@ -180,5 +180,28 @@ namespace Saviour_Backup_System
return table; 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();
}
} }
} }