问一下各位:
表名fq
csDataContext cdc = new csDataContext();
var query = cdc.fq.Single(m => m.xid==103);
query.xage = 25;
cdc.SubmitChanges();
这样只能改一行记录(xid为103的),如果想改xid>103得怎么写。
single只能改一个元素呀
------解决方案--------------------------------------------------------
try->
- C# code
csDataContext cdc = new csDataContext(); var query = cdc.fq.Where(m => m.xid>103); //过滤出xid>103的集合foreach(var q in query ){ q.xage=25;}cdc.SubmitChanges();