Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Why sum in group Not Work SQlite
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mohsen  
View profile  
 More options Jan 15 2011, 3:03 pm
From: Mohsen <mohsen....@gmail.com>
Date: Sat, 15 Jan 2011 12:03:32 -0800 (PST)
Local: Sat, Jan 15 2011 3:03 pm
Subject: Why sum in group Not Work SQlite
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mohsen  
View profile  
 More options Jan 19 2011, 4:43 am
From: Mohsen <mohsen....@gmail.com>
Date: Wed, 19 Jan 2011 01:43:40 -0800 (PST)
Local: Wed, Jan 19 2011 4:43 am
Subject: Re: Why sum in group Not Work SQlite
I use Other Linq to SQLite and solve this problem , I think this is a
bug.
Thank You

On Jan 15, 11:03 pm, Mohsen <mohsen....@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »