62,074
社区成员
发帖
与我相关
我的任务
分享
if (e.CommandName == "Update")
{
string name = ((TextBox)e.Item.FindControl("txtNameE")).Text;
Bind();
Response.Write("<script>alert('没有ID为:" + name + "这个人!');</script>");
}
if (e.CommandName == "Update")
{
string name = ((TextBox)e.Item.FindControl("txtNameE")).Text;
Bind();
Response.Write("<script>alert('没有ID为:" + name + "这个人!');</script>");
}
string sqlUpdate = "Update Personnel set Name=@Name,Phone=@Phone,Address=@Address where lID=@ID";
Personnel personnel = new Personnel();
personnel.ID = DataList1.DataKeys[e.Item.ItemIndex].ToString();
personnel.Name = ((TextBox)e.Item.FindControl("txtNameE")).Text;
personnel.phone = ((TextBox)e.Item.FindControl("txtPhoneE")).Text;
personnel.address = ((TextBox)e.Item.FindControl("txtAddressE")).Text;
PBLL p = new PBLL();
if (p.Update(personnel, sqlUpdate))
{
---- 更新成功---SQL语句没错,上面控件的值是还是原来Eval()绑定的,输入的值传不进来
}
Bind();