Group By with Doodads

All your dOOdad needs ...

Group By with Doodads

Postby ahsan on Fri Jul 08, 2005 11:37 am

How to use Group By clause with Doodads ?
Syed Ahsan Askari,
Software Engineer,
AMZXs
syed.ahsan@amzxs.com,
www.amzxs.com
ahsan
Lurker
 
Posts: 5
Joined: Thu Jan 06, 2005 6:52 am
Location: Karachi

Postby mike.griffin on Fri Jul 08, 2005 12:21 pm

Use \"BusinessEntity.LoadFromRawSql\", they dynamic query doesn't support it.

EXAMPLE
Code: Select all
public class Employees : _Employees
{
    public bool MySpecialLoad()
    {
        // Load All Employees with an 'o' in the last name
        return base.LoadFromRawSql(\"Select * from Employees where LastName LIKE {0}\", \"%o%\");
    }
}
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby sbc on Fri Jul 08, 2005 3:53 pm

A better way could be to create a view containing GROUP BY and with the same columns as your table, and use QuerySource:
Code: Select all
Employees emps = new Employees();
emps.QuerySource = \"myView\";
if (emps.Query.Load())
{
...
}
User avatar
sbc
Expert
 
Posts: 446
Joined: Sat Apr 03, 2004 6:10 am
Location: North East Lincolnshire, England

Postby mike.griffin on Fri Jul 08, 2005 3:56 pm

Great idea SBC
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby mike.griffin on Thu Sep 01, 2005 10:24 pm

User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN


Return to dOOdads - MyGeneration's .NET Architecture

Who is online

Users browsing this forum: No registered users and 2 guests

cron