【发布时间】:2014-01-06 14:07:01
【问题描述】:
var GrandTotal = dt.AsEnumerable().Sum(cols => Convert.ToDecimal(cols.Field<string>("TotalPrice")));
给出错误:
Unable to cast object of type 'System.Decimal' to type 'System.String'
如何改正?
【问题讨论】:
标签: c# linq datatable linq-to-dataset