How to Sum a column on db server

Posts   
 
    
jthieret
User
Posts: 3
Joined: 24-Feb-2012
# Posted on: 23-Apr-2012 22:31:09   

Using SqlServer 2008. LLBLGen Pro 3.1.

I am a noob with lambda syntax as well as LLBLGen pro.

I want to sum the TotalCharge column but i want Sql Server to do the summing.

The following causes the summing to happen on the client, not the server:

WithMetadata(lmd => lmd.BillingDetail.Where(c => (c.BillId ==billEntity.BillId)) .Select(t=>t.TotalCharge).Sum());

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-Apr-2012 06:54:09   

That query should do the sum on the server. Please post the generated SQL. Also, make sure you are using the latest version of the runtime library version. What does the WithMetadata(...) ?

David Elizondo | LLBLGen Support Team