Al actualizar con la ayuda de LINQ to SQL utilizando Entity Framework, se lanza una excepción.¿Por qué recibo la excepción "No se puede actualizar EntitySet porque tiene una excepción DefiningQuery ..." cuando intento actualizar un modelo en Entity Framework?
System.Data.UpdateException: Unable to update the EntitySet 't_emp' because it has
a DefiningQuery and no <UpdateFunction> element exists in the
<ModificationFunctionMapping>
El código para la actualización es:
public void Updateall()
{
try
{
var tb = (from p in _te.t_emp
where p.id == "1"
select p).FirstOrDefault();
tb.ename = "jack";
_te.ApplyPropertyChanges(tb.EntityKey.EntitySetName, tb);
_te.SaveChanges(true);
}
catch(Exception e)
{
}
}
¿Por qué recibo este error?
¡Has ahorrado mi tiempo! Gracias – Hamdi
Mi tiempo también, ¡Gracias! – Bojangles
¡problema muy raro! gracias por ahorrar tiempo –