Very odd. Incase I messed up, here's the _exact_ code I use
private class DoubleObj
{
public double AmountSum { get; set; }
}
try
{
var inc =
conn.Query<DoubleObj>("select sum(Amount) as AmountSum from
\"Transaction\" where Direction = ? and TransactionDate between ? and
?",
(int)TransactionDirection.Income,
taxSettings.StartDate, taxSettings.EndDate).FirstOrDefault
();
income += inc.AmountSum;
} catch (Exception ex) {
Util.LogException(ex);
income += 0;
}
This is in a working app. The sqlite-net version is the latest, I
think - defn as of December 2011.
On Wed, May 23, 2012 at 11:49 AM, Guido Van Hoecke <[email protected]> wrote:
> Hi Nic,
>
> Thanks for your speedy answer.
>
> On 23 May 2012 11:42, Nic Wise <[email protected]> wrote:
>> You have to return a class (this bit me, too - I'm using sums)
>>
>> class IntWrapper
>> {
>> public int Count { get; set; }
>> }
>>
>> var list = Db.Con.Query<IntWrapper>("select count(*) as count from
>> mytable");
>> return list[0].Count;
>>
>
> This is exactly what I tried in an earlier iteration, so I tried it
> again. Unfortunately I still get 0 as result value...
>
>
>
> With kind regards,
>
>
> Guido
>
> --
> The explanation requiring the fewest assumptions
> is the most likely to be correct.
> -- William of Occam
--
Nic Wise
t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/
Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch