将
BEGIN
END语句包装在您的批量插入内容周围。Sqlite已针对事务进行了优化。
dbcon = new SQLiteConnection(connectionString);dbcon.Open();SQLiteCommand sqlComm;sqlComm = new SQLiteCommand("begin", dbcon);sqlComm.ExecuteNonQuery(); //---INSIDE LOOP sqlComm = new SQLiteCommand(sqlQuery, dbcon); nRowUpdatedCount = sqlComm.ExecuteNonQuery();//---END LOOPsqlComm = new SQLiteCommand("end", dbcon);sqlComm.ExecuteNonQuery(); dbcon.close();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)