linq修改数据
dblinqDataContext linq = new dblinqDataContext();
var query = from s in linq.hUsers
where s.Husername == Request.Form["username"] && s.Hpassword == Request.Form["password"]
select new
{
HautoID = s.HautoID,
Hage = s.Hage.Value,
Hcity = s.Hcity
}
查询后想这么写修改数据,可是不行
foreach (var r in query)
{
r.Hage = Convert.ToInt16(Request.Form["Hage"]);
r.Hcity = Convert.ToInt16(Request.Form["Hcity"]);
}