Commit 88d6dc06 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 SQLite 连接字符串添加 BusyTimeout=100, 用于解决当前写入数据库时,执行读取,会弹出BUSY(5)。 起码会各等100ms。调用时,还需要使用try catch

parent 2c9d6c0f
......@@ -19,7 +19,8 @@ namespace SQLite
{
get
{
return string.Format("Data Source={0};Version=3;", DBPath);
//超时100ms
return string.Format("Data Source={0};Version=3;BusyTimeout=100", DBPath);
}
}
public string DBPath { get; private set; } = @"test.sqlite3";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment