DataTable dt = new DataTable(); dt.Columns.Add("A",typeof(string)); dt.Columns.Add("B",typeof(Int32)); dt.Rows.Add("标识1", 100); dt.Rows.Add("标识2", 30); dt.Rows.Add("标识2", 40); dt.Rows.Add("标识3", 80); var query = from c in dt.AsEnumerable() group c by c.Field<string>("A") into g select new { zhujian=g.Key, tongji = g.Sum(s => s.Field<Int32>("B")) }; Console.WriteLine("A"+" B"+" "+"================="); foreach (var item in query) { Console.WriteLine("" + item.zhujian + " " + item.tongji); }