private void dg_lb_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { string lbid=e.Item.Cells[0].Text.Trim(); string lbname_New =((TextBox)e.Item.Cells[1].Controls[0]).Text.Trim(); if(lbnameis_repeat(lbname_New)) { OracleBase ob=new OracleBase(1); ob.Open(); string name_str="update t_lb set lb_name='"+lbname_New+"' where lb_id='"+lbid+"' "; ob.ExecSQLCommand(name_str); dg_lb.SelectedIndex=-1; this.dg_lb.EditItemIndex=-1; getjclb(); Response.Write("<script>alert('保存成功!');</script>"); } else { Response.Write("<script>alert('监测类别名称重复,请重新输入!');</script>"); } }