I have seen examples of multiply group by columns, but for classes. I am trying to do this for a EnumerableDataRowList. but I get “Invalid anonymous type member declarator.”
EnumerableDataRowList<DataRow> enumerableRowCollection = new EnumerableDataRowList<DataRow>(reportData.Select("WeekKey <> '0'"));
var groupedRows1 = from row in enumerableRowCollection
group row by new {row["NETWORK"], row["Week"] };
also, I seen some people combine the columns in some case to get the same results. Any benefit in doing it that way
You have to assign an identifier to the values:
You normally aren’t required to specify an identifier if you’re using a field or property reference as it’ll just reuse the name of that member – but in this case you’re accessing an indexer property, so there’s no way to get a name from it.