Page 1 of 1

How to Sort list of Products

Posted: Wed Aug 06, 2008 11:52 am
by Mike718NY
This gives a list of products for a Manufacturer.
But how can I sort it by Name, ASC ???

ProductCollection productByManList = ProductDataSource.LoadForCriteria("ManufacturerId = 3");
foreach (Product p in productByManList)
{
...............

Same here, I want to sort this by Name, ASC :

ManufacturerCollection allMans = ManufacturerDataSource.LoadForStore();
foreach (Manufacturer thisMan in allMans)
{
.........

Re: How to Sort list of Products

Posted: Wed Aug 06, 2008 12:02 pm
by heinscott
ProductCollection productByManList = ProductDataSource.LoadForCriteria("Manufacturer = 3", "name ASC");
The second argument "name ASC" is the Order By sql statement.

Scott

Re: How to Sort list of Products

Posted: Wed Aug 06, 2008 12:33 pm
by Mike718NY
thanks again Scott