代码如下:
//double num=dt.AsEnumerable().Select(row => Convert.ToDouble(row.Field<string>("Id"))).Sum(); //double num2 = dt.AsEnumerable().Sum(row => Convert.ToDouble(row.Field<string>("Id"))); double num = dt.AsEnumerable().Select(row => Convert.ToDouble(row["Id"])).Sum(); double num2 = dt.AsEnumerable().Sum(row => Convert.ToDouble(row["Id"]));
时间: 2024-12-25 13:58:40