c# - Using LINQ to SQL to perform an update/set -
so, if use query directly or using db.executecommand()
, work fine;
update market..area set enddate = null id = 666 , nid =1 , code = 36003
however, cant seem in linq sql, i've tried few different methods seem should work, here example of one:
var s= db.area.single(s => s.id == 666 && s.code == 36003 && s.nid == 1); s.enddate = null; db.submitchanges();
i dont know else try working.
edit
i trying edit 1 item
is there primary key defined on area table? linq 2 sql not make update table without primary key defined. (and, far can remember, fail silently).
Comments
Post a Comment