In SQL, the general rule of thumb is that the number of rows returned from a SELECT will be zero if your criteria did not match any data. However, there is an important exception to this rule: it does not apply when asking for aggregate calculations such as SUM(), MIN() or MAX(), without any grouping. read more...
In ASP.NET, we often would like to output "grouped" data on our web pages, like this:
Customer Product Sales
-------- ---------- -----
ABC Foundation
Product 1 $200
Product 2 $437
Product 3 $523
The XLZ Company
Product 1 $240
Product 2 $892
Product 3 $395
The easiest way to do this is with nested Repeater controls; one for the outer group (Customers, this case), and within that Repeater's ItemTemplate we'd have another Repeater control for the details (Products).
To use nested repeaters, you would return two separate result sets from SQL:
A "Customers" result set,...