How to use SQLITE RunInTransactionAsync

0

I need to insert a large number of lines (exactly 221) when I start my WP application. Actually I'm using arrays and loop% re% loop, so I'm losing performance when I start the app.

I searched a little about for , did not find much, but is there any way to make this RunInTransactionAsync faster?

for (var i = 0; i < 221; i++)
{
   var hino = new hinos() { numHino = array.numeroHinos[i], favHino = array.favHinos, nomeHino = array.nomeHinos[i], catHino = array.categoriaHinos[i], letraHino = array.letraHinos[i] };
   await con.InsertAsync(hino);                 
}
    
asked by anonymous 04.11.2015 / 01:13

1 answer

0

A suggestion I saw here is to do this:

INSERT INTO 'tablename'
          SELECT 'data1' AS 'column1', 'data2' AS 'column2'
UNION ALL SELECT 'data1', 'data2'
UNION ALL SELECT 'data1', 'data2'
UNION ALL SELECT 'data1', 'data2'

At the time I did not implement, I changed my concept, I hope it helps you.

    
04.11.2015 / 02:24