public ActionResult UpdateData3() { string sql = "update Donation set TestResultStatus = 2 where TestResultStatus == 0 and (TR_HIV = 1 or TR_HCV_ab = 1 or tr_hbs_ag = 1 and tr_malaria = 2 and tr_syphilis = 2)"; RedBloodDataContext db = new RedBloodDataContext(); db.ExecuteCommand(sql); return View("About"); }
public static void Run_Startup_SqlScript() { try { var path = HttpContext.Current.Server.MapPath("~/script1.sql"); string sql = File.ReadAllText(path); RedBloodDataContext db = new RedBloodDataContext(); db.ExecuteCommand(sql); } catch (Exception ex) { } }