Why sum in group Not Work SQlite

62 views
Skip to first unread message

Mohsen

unread,
Jan 15, 2011, 3:03:32 PM1/15/11
to DbLinq
Hello to all
I write this code but i have an exception when run it .i use dblinq
and sqlite
Exception :
Argument type 'Agancy.AccDetail' does not match the corresponding
member type 'System.Int32'

My C# Code :

var query = from d in database.GetTable<AccDetail>()
group d by d.Account into dacc
select new
{
id = dacc.Key,
gCost = dacc.Sum(p => p.GetCost),
pCost = dacc.Sum(p => p.PayCost)

};

and this is my table:

CREATE TABLE [accDetail] (
[id] integer PRIMARY KEY NOT NULL,
[account] integer NOT NULL,
[getCost] integer NOT NULL,
[comment] nvarchar(250),
[cDate] nvarchar(10) NOT NULL,
[payCost] integer NOT NULL,
CONSTRAINT [FK_accDetail_0] FOREIGN KEY ([account]) REFERENCES
[account] ([id])
)


but when i run my SQL command all things is true

SELECT account,Sum(getCost),Sum(payCost)
FROM accDetail GROUP BY account

Mohsen

unread,
Jan 19, 2011, 4:43:40 AM1/19/11
to DbLinq
I use Other Linq to SQLite and solve this problem , I think this is a
bug.
Thank You
Reply all
Reply to author
Forward
0 new messages