代码:
Domain ob = new Domain();
[HttpPost]
public ActionResult Create(Domain ob)
{
try
{
//// TODO: Add insert logic here
FirstTestDataContext db = new FirstTestDataContext();
tblSample ord = new tblSample();
ord = ob;
db.tblSamples.InsertOnSubmit(ord);
db.SubmitChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}
在这里我收到这样的错误
无法将类型“mvcInsertLinqForms.Models.Domain”隐式转换为“mvcInsertLinqForms.tblSample”