根据条件删除

        /// <summary>
        /// 删除检测项目
        /// </summary>
        private void DelPBItem()
        {
            string msg = "0";
            string id = Request.Form["ipt_biotestplanheaderid"];
            string pbItemCode = Request.Form["ipt_pbitemcode"];
            if (!string.IsNullOrEmpty(id))
            {
                string strWhere = "BioTestPlanHeaderID=" + id + "AND PBItemCode=" + pbItemCode;                 
                DataSet ds = bioTestPlanBodyBll.GetList(strWhere);
                int count = ds.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    int reviewid = Convert.ToInt32(ds.Tables[0].Rows[i]["BioTestPlanBodyID"].ToString());
                    bioTestPlanBodyBll.Delete(reviewid);
                }
                //if (bioTestPlanBodyBll.DeleteList(id))
                // {
                msg = "操作成功";
                //}
            }
            WebCommon.WriteMsg(msg);
        }

原文地址:https://www.cnblogs.com/IT1517/p/4956040.html