DataClassesDataContext DC = new DataClassesDataContext();
var query = from a in DC.Activities
where a.ZhangHao == "zb09nju"
select a;
if(query.Count()>0)
{
Activities[] actiObjsArr=new Activities[query.Count()];
int i=0;
foreach(Activities item in query)
{
actiObjsArr[i]=item;
++i;
}
for (int n= 0; n < i; ++n)
{
DC.Activities.Remove(actiObjsArr[n]);
DC.SubmitChanges();
}
}
Linq删除
最新推荐文章于 2023-10-06 06:25:09 发布