public bool BackupDataBase(string backupFileName) { string statement = string.Format("BACKUP DATABASE {0} to disk ='{1}\\{2}'", ConfigurationManager., ConfigurationManager.FtpDirectoryOnServer, backupFileName); bool result = executer.ExecuteNonQuery(statement, null); if (result) { try { StringBuilder sB = new StringBuilder(); sB.Append(ConfigurationManager.FtpDirectoryOnServer); sB.Append("\\"); sB.Append(backupFileName); byte[] file = FTPClient.DownloadFile(backupFileName); return(FileDAO.StoreFile(file)); } catch { return(false); } } return(result); }
public bool BackupFile(string serverFilePath) { byte[] file = FTPClient.DownloadFile(serverFilePath); return(FileDAO.StoreFile(file)); }