c# - Aggregate/Sum Uppercase Case Sensitive Issue -
i have following code use aggregate , sums. problem have source data populates account# column upper , lower case.
i need aggregate/sum regardless of case.
i have tried case insensitive dont seem have got work.
i thinking maybe need clone account# column , make uppercase use clone, unsure how make column uppercase.
please tell me how make code aggregate/sum regardless of case.
thanks
var accountgroups = completedt_svc_ro_dr.asenumerable() .groupby(x => new { accno = x.field<string>("account#"), description = x.field<string>("d e s c r p t o n . . . . . . . . . . . . x") .tostring() }) .select(grp => new { account = grp.key.accno, descrpt = grp.key.description, count = grp.sum(row => row.field<int>("cur-balance....")) }); var completedt_svc_ro_dr_cr = new datatable(); completedt_svc_ro_dr_cr.columns.add("d e s c r p t o n . . . . . . . . . . . ."); completedt_svc_ro_dr_cr.columns.add("account#"); completedt_svc_ro_dr_cr.columns.add("cur-balance...."); foreach (var grp in accountgroups) completedt_svc_ro_dr_cr.rows.add(grp.descrpt, grp.account, grp.count);
Comments
Post a Comment