protected void btniDelete_Click(object sender, EventArgs e) { int[] intRowindexarray = secondGrid.SelectedRowIndexArray; if (intRowindexarray.Length > 0) { cd_thermal_indicator cti = new cd_thermal_indicator(); object[] keys = secondGrid.DataKeys[intRowindexarray[0]]; string strID = keys[0].ToString(); string strtid = keys[1].ToString(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("ID", " cast(ID as varchar(36))='" + strID + "' "); int intresult = cti.deletebycondition("cd_thermal_indicator", dic); Alert alert = new Alert(); BindGrid(strtid); if (intresult > 0) { alert.Icon = Icon.Information; alert.Message = "成功移除数据"; } else { alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Message = "数据移除失败"; } alert.Show(); } }