我已尝试SQLiteConnection(":memory:")
和SQLiteConnection("sqlite::memory:")
,但这两项都失败了'无效的ConnectionString格式'
答案 0 :(得分:77)
试
var connection = new SQLiteConnection("Data Source=:memory:");
答案 1 :(得分:4)
我正在使用它:
var connectionStringBuilder = new SQLiteConnectionStringBuilder { DataSource = ":memory:" };
var connection = new SQLiteConnection(connectionStringBuilder.ToString());
答案 2 :(得分:2)
也许为时已晚,但FullUri=file::memory:?cache=shared;
正在发挥作用。