private List<int> listAreaId = new List<int>(); /// <summary> /// 递归获取本区域下面的所有子集 /// </summary> /// <param name="areaId"></param> private void GetAreaListId(int areaId) { string sql = string.Format(@"SELECT area_id FROM bi_area WHERE parent_id={0}", areaId); var dt = DBUtil.DiningBaseInfo.ADO.ExecuteDataTable(sql); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { listAreaId.Add(Convert.ToInt32(dr["area_id"].ToString())); GetAreaListId(Convert.ToInt32(dr["area_id"].ToString())); } } }