I'd do this, if I was you:
open connection
being a transaction if you need to.
try {
using connection {
loop over xml:
read xml into an object
update ALL objects into the DB at the same time
}
finally:
commit etc
close connection
No need to open/close each time. If use sqlite-net if you can - the
insertall of a list of objects is a LOT LOT quicker than doing it each
time, from memory....
On Fri, May 13, 2011 at 09:49, AnthonyLambert <[email protected]> wrote:
> Why are you closing the connection each time?
>
> Connections are usually held open for the life of the app? Or at least
> across many transactions done at one time.
>
> I would imagine that you have dis-joined open and closes in your app. so you
> are trying to open an already open db maybe?
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/SQLite-Cannot-open-database-tp3514915p3519730.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
--
Nic Wise
t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise
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