I'm using LLBLGen 1.0.2005.1 with the self servicing classes. I have a SQL query with a group by clause and I'm interested in retrieving the count for each group. The SQL is as follows:
SELECT ProductName, VendorName, COUNT(*)
FROM Product
GROUP BY ProductName, VendorName
So far I have:
ResultsetFields fields = new ResultsetFields(2);
fields.DefineField(ProductFieldIndex.ProductName, 0, AggregateFunction.None)
fields.DefineField(ProductFieldIndex.VendorName, 1, AggregateFunction.None)
GroupByCollection groupBy = new GroupByCollection();
groupBy.Add(fields[0]);
groupBy.Add(fields[1]);
DataTable results = new DataTable();
TypedListDAO dao = new TypedListDAO();
dao.GetMultiAsDataTable(fields, results, 0, null, null, null, false, groupBy, null, 0, 0);
How can I add a field to resemble COUNT(*)?