예제 #1
0
        public ActionResult Upload(HttpPostedFileBase file)
        {
            if (file != null && file.ContentLength > 0)
            {
                var fileName = Path.GetFileName(file.FileName);
                //var path = Path.Combine(Server.MapPath("~/Images/Database/"), fileName);
                file.SaveAs(BackupRestore.Getdatabases("(local)").BackupDirectory + "\\FullBackUp.bak");
                BackupRestore.RestoreDatabase();
            }



            return(RedirectToAction("RestoreDatabase"));
        }
예제 #2
0
 public static void RestoreDatabaseFromBackUp()
 {
     BackupRestore.RestoreDatabase(Constants.Server,
         Constants.DatabaseName,
         Constants.BackUpPath);
 }