1
Answer

error in MVC_PracticeEntities

jabbar razi

jabbar razi

7y
338
1
hi,
 the following is giving error can you please let me know on this
using (MVC_PracticeEntities objContext = new MVC_PracticeEntities())
 
 
complete code as follows
 
public ActionResult Insert(FormCollection Fc)
{
using (MVC_PracticeEntities objContext = new MVC_PracticeEntities())
{
tbl_FormCollectionUse Tbl = new tbl_FormCollectionUse();
//
Tbl.Name = Fc["TxtName"].ToString();
Tbl.Mobile = Convert.ToInt64(Fc["Mobile"]);
Tbl.EmailID = Fc["TxtEmailID"].ToString();
Tbl.Address = Fc["TxtAddress"].ToString();
//
objContext.AddTotbl_FormCollectionUse(Tbl);
//
int i = objContext.SaveChanges();
if (i > 0)
{
ViewBag.Msg = "Data Saved Suuceessfully.";
}
}
return View();
}
 
 
thanks
syed 
 

Answers (1)