From c526fd326827cab1125747907841b00bda9b831f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 4 Jan 2015 14:35:19 +0000 Subject: [PATCH] added function to find if drive is going to be compressed --- Saviour Backup System/databaseTools.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Saviour Backup System/databaseTools.cs b/Saviour Backup System/databaseTools.cs index 03be0a6..be9a76d 100644 --- a/Saviour Backup System/databaseTools.cs +++ b/Saviour Backup System/databaseTools.cs @@ -151,6 +151,23 @@ namespace Saviour_Backup_System return hash; } + public static bool isCompression(string id) + { + conn.Open(); + bool compression = false; + cmd.CommandText = "SELECT Compression FROM Recordset WHERE Drive_ID Like ?;"; + cmd.Parameters.Add(new SqlCeParameter("Drive ID", SqlDbType.NText)); + cmd.Parameters["Drive ID"].Value = id; + SqlCeDataReader reader = cmd.ExecuteReader(); + while (reader.Read()) { + compression = reader.GetBoolean(0); + } + cmd.Parameters.Clear(); + reader.Close(); + conn.Close(); + return compression; + } + public static DataTable getAllDriveBackups() { DataTable table = new DataTable();