added database code to update form
This commit is contained in:
parent
391d4485de
commit
51d11b2334
1 changed files with 23 additions and 0 deletions
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue