public static bool GetBackupStatus(NLog.Logger log, SqlConnectionStringBuilder connectionString, string backupName) { CheckDatabaseStatusTask checkDatabaseStatusTask = new CheckDatabaseStatusTask { ConnectionString = connectionString, BackupName = backupName, WhatIf = false // WhatIf isn't used by this task. }; checkDatabaseStatusTask.Execute(); if (checkDatabaseStatusTask.State == 0) { log.Info("Copy of {0} to {1} complete!", connectionString.InitialCatalog, backupName); } return(checkDatabaseStatusTask.State == 0); }
public static bool GetBackupStatus(NLog.Logger log, SqlConnectionStringBuilder connectionString, string backupName) { CheckDatabaseStatusTask checkDatabaseStatusTask = new CheckDatabaseStatusTask { ConnectionString = connectionString, BackupName = backupName, WhatIf = false // WhatIf isn't used by this task. }; checkDatabaseStatusTask.Execute(); if (checkDatabaseStatusTask.State == 0) { log.Info("Copy of {0} to {1} complete!", connectionString.InitialCatalog, backupName); } return checkDatabaseStatusTask.State == 0; }