Mohsen
unread,Jan 15, 2011, 3:03:32 PM1/15/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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