DataTable dt = dataSet.Tables[0]; var query = from t in dt.AsEnumerable() group t by new { t1 = t.Field<string>("username"), t2 = t.Field<string>("department"), t3 = t.Field<string>("sex") } into m select new { username = m.Key.t1, department = m.Key.t2, sex = m.Key.t3 };