日期:2014-05-20 浏览次数:20667 次
CPJCDataDataContext cc = new CPJCDataDataContext(); LinkButton lbn = (LinkButton)sender; int index = ((GridViewRow)lbn.NamingContainer).RowIndex; int id = Convert.ToInt16(GridView1.DataKeys[index].Value); City city = cc.City.Where(p => p.Parent_ID == id).FirstOrDefault(); cc.City.DeleteOnSubmit(city); cc.SubmitChanges(); //因为parent_id有很多个,如果我这样写的话,只能删除一个,请问,我该怎么写???