when i tried to run it it faces the error like "
CS0161 C# : not all code paths return a value
" please suggest me the way that it can solve my error
[HttpPost]
public ActionResult Create(Student s)
{
if(ModelState.IsValid==true)
{
db.Students.Add(s);
int a = db.SaveChanges();
if (a > 0)
{
//ViewBag.InsertMessage = "<script>alert('Dta Inserted Successfully...!!!')</script>";
TempData["InsertMessage"] = "<script>alert('Dta Inserted Successfully...!!!')</script>";
return RedirectToAction("Index");
}
else
{
ViewBag.InsertMessage = "<script>alert('Dta Not Inserted Successfully...!!!')</script>";
return View();
}
}
}