// GET: Db public ActionResult Index() { bool bStatus = DB.Open(); if (bStatus) { return(Content(bStatus.ToString())); } else { return(Content(bStatus.ToString())); } }
public ActionResult SaveDataStudent(StudentModel f) { if (ModelState.IsValid) { D.Open(); int i = D.DataInsert("INSERT INTO tblproduct(productname,quantity,price)VALUES('" + f.productname + "','" + f.quantity + "','" + f.price + "',)"); if (i > 0) { ModelState.AddModelError("Success", "Save Success"); } else { ModelState.AddModelError("Error", "Save Error"); } D.Close(); } return(RedirectToAction("Index", "Student")); }