SQLite/C# Connection Pooling and Prepared Statement Confusion

后端 未结 2 1876
南方客
南方客 2020-12-09 07:46

I have been spending some time reading different best practices for databases and for SQLite specifically. While reading I found I was doing many things I shouldn\'t be doin

2条回答
  •  我在风中等你
    2020-12-09 08:13

    I didn't catch exactly what is the core problem, but if the problem is how to insert bulk insert statements in one transaction in so little time.

    Here is a helper class I found earlier that could help you:

    SQLiteBulkInsertHelper.cs

    You can use it like this:

    SQLiteBulkInsertHelper ContactBlk = new SQLiteBulkInsertHelper("","");
    ContactBlk.AllowBulkInsert = true;
    ContactBlk.AddParameter("", /*Column Data Type*/System.Data.DbType.Int64);
    ContactBlk.AddParameter("", /*Column Data Type*/System.Data.DbType.String);
    ContactBlk.Insert(new object[] {,});
    ContactBlk.Flush();
    
    
    

    Give it a try if you see it as a solution to your problem.

    提交回复
    热议问题