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

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to