1
Fork 0

changed SQL values to make them more efficient.

This commit is contained in:
Jake Howard 2014-12-15 16:12:57 +00:00
parent a1460d1deb
commit 01e88de6dd

View file

@ -84,7 +84,7 @@ namespace Saviour_Backup_System
return name; return name;
} }
public static void createBackupRecord(DriveInfo drive, Int64 startDate, Int64 duration) public static void createBackupRecord(DriveInfo drive, Int64 startDate, Int64 duration, string hash)
{ {
string id = USBTools.calculateDriveID(drive); string id = USBTools.calculateDriveID(drive);
conn.Open(); conn.Open();
@ -98,8 +98,8 @@ namespace Saviour_Backup_System
cmd.Parameters["Drive ID"].Value = id; cmd.Parameters["Drive ID"].Value = id;
cmd.Parameters["Start Date"].Value = startDate; cmd.Parameters["Start Date"].Value = startDate;
cmd.Parameters["Backup Name"].Value = getBackupName(drive); cmd.Parameters["Backup Name"].Value = getBackupName(drive);
cmd.Parameters["Hash"].Value = tools.hashDirectory(drive.Name); cmd.Parameters["Hash"].Value = hash;
cmd.Parameters["Duration"].Value = duration; cmd.Parameters["Duration"].Value = (int)duration;
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
cmd.Parameters.Clear(); cmd.Parameters.Clear();
conn.Close(); conn.Close();