估计是e.Item.ItemIndex这里出现问题了。你需要从下拉列表中找到要删除记录的ID号,应该是这样取ID,int id = (int)e.Item[e.Item.ItemIndex].Value;
sql_comm.Parameters["@p_id"].Value = DataGrid1.DataKeys[id];
sql_comm.Parameters["@p_id"].Value = DataGrid1.DataKeys[id];
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货