I'm currently trying to add a lot of data to a SQLite database in my Windows 8 App using C# and System.Data.SQLite. I have all the objects (MediaItem) in a list and I'm adding each one to the database using a foreach-loop. Unfortunatley this is pretty slow, so I'm wondering if there's a way to speed things up. Can I for example hand over the complete list to the database? Here's my code so far:
List<MediaItem> items;
// adding lots of onbjects to the list...
using (var db = new SQLiteConnection(dbPath))
{
foreach (var item in items)
{
db.Insert(item);
}
}