DataTable ı linq ile gruplama
DataTable dataTable = pos.Banka(); var groupedData = from b in dataTable.AsEnumerable() group b by b.Fieldwhere sorgusu("BANKA_KOD") into g select new { BANKA_KOD = g.Key //ChargeTag = g.Key, //Count = g.Count(), //ChargeSum = g.Sum(x => x.Field ("charge")) };
foreach (var item in groupedData) { var banka = from b in dataTable.AsEnumerable().Where(x => x.Field("BANKA_KOD") == item.BANKA_KOD) select b; }