StringBuilder str = new StringBuilder(); var res = new ResParameter() { code = ResponseCode.exception }; var result = from isbn in dt.AsEnumerable() group isbn by isbn.Field<string>("isbn") into grp where grp.Count() > 1 select grp.Key; if (result.Count() > 0) { foreach (var item in result) { str.Append(item + ", "); } res.info ="导入EXCEL中包含重复ISBN' "+ str.ToString()+"' 请整理后再重新导入"; return res; }