jabbar razi

jabbar razi

  • NA
  • 1
  • 329

error in MVC_PracticeEntities

Mar 8 2016 12:10 AM
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)