标签:net return span reac tar 字符串 gets nbsp class
原文:https://blog.csdn.net/u011444756/article/details/104941981
/// <summary> /// DataTable追加合计 /// </summary> /// <param name="dt">数据源</param> /// <param name="sumColumns">给哪一列赋值"合计"字符串</param> /// <returns></returns> public static DataTable getSumToDatatable(DataTable dt, string sumColumns) { string ColumnName = ""; DataRow sum = dt.NewRow(); sum[sumColumns] = "合计"; foreach (DataColumn col in dt.Columns) { Type dataType = col.DataType; ColumnName = col.ColumnName; if (dataType.Name == "Decimal") { sum[ColumnName]= dt.Compute($"sum({ColumnName})", "TRUE"); } } dt.Rows.Add(sum); return dt;
标签:net return span reac tar 字符串 gets nbsp class
原文地址:https://www.cnblogs.com/zhang1f/p/13083418.html