What is the fastest way to populate a SQLite database from a DataTable in C# .net 2.
Currently I am building insert statments for each row in the table. I have tried a dataadaptor but the speed didn't seem to be any faster. It currently takes 5 min to loop through 20,000 rows and write them to the database. Any sugestions?
solution:
I found that surounding blocks of insert statments with BEGIN...COMMIT worked for me with a remarkable speed improvement:
BEGIN;
INSERT INTO friends (name1,name2) VALUES ('john','smith');
INSERT INTO friends (name1,name2) VALUES ('jane','doe');
COMMIT;
my insert statements were around 500 byte each, so I limited the number of statements to 100 per transaction.