问题描述
怎样实现点击按钮,将gridview选中的数据删除掉
解决方案
解决方案二:
http://www.lmwlove.com/ac/ID455
解决方案三:
protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse){stringsqlstr="deletefrom表whereid='"+GridView1.DataKeys[e.RowIndex].Value.ToString()+"'";sqlcon=newSqlConnection(strCon);sqlcom=newSqlCommand(sqlstr,sqlcon);sqlcon.Open();sqlcom.ExecuteNonQuery();sqlcon.Close();bind();();//数据绑定函数,更新gridview}
时间: 2024-10-24 11:50:10