/// <summary> /// 求总记录数 /// </summary> /// <param name="_fname"></param> /// <returns></returns> private string GetCountData(string _fname) { if (this.FieldsDictionary.ContainsKey(_fname)) { RealColumnDefine _col = this.FieldsDictionary[_fname]; DataTable _dt = this.QueryResultData.Tables[_col.TableName]; return(_dt.Compute(string.Format("count({0})", _col.ColumnName), "").ToString()); } else { return(""); } }
/// <summary> /// 求总和 /// </summary> /// <param name="_fname"></param> /// <returns></returns> private string GetSumData(string _fname) { if (this.FieldsDictionary.ContainsKey(_fname)) { RealColumnDefine _col = this.FieldsDictionary[_fname]; DataTable _dt = this.QueryResultData.Tables[_col.TableName]; if (_dt.Columns[_col.ColumnName].DataType == typeof(decimal)) { return(_dt.Compute(string.Format("sum({0})", _col.ColumnName), "").ToString()); } return(""); } else { return(""); } }