62,025
社区成员
发帖
与我相关
我的任务
分享
string sql = "delete from food where foodName='" + GridView1.DataKeys[e.RowIndex].Value.ToString() +"'";
SqlConnection con = new SqlConnection(constr);
con.Open();
SqlCommand cmd = new SqlCommand(sql, con);
int i = cmd.ExecuteNonQuery();
if (i>0)
{
Response.Write("<script>alert('删除成功')</script>");
}
else
{
Response.Write("<script>alert('删除失败')</script>");
}
con.Close();
Page_Load(sender,e);