我曾尝试过使用 SQLiteConnection(":memory:")
和 SQLiteConnection("sqlite::memory:")
,但两者都因为'无效的ConnectionString格式'而失败。
var connection = new SQLiteConnection("Data Source=:memory:");
var connectionStringBuilder = new SQLiteConnectionStringBuilder { DataSource = ":memory:" };
var connection = new SQLiteConnection(connectionStringBuilder.ToString());
FullUri=file::memory:?cache=shared;
是可以使用的。
var connection = new SqliteConnection("FullUri=file::memory:?cache=shared;");
时,我收到了System.ArgumentException: Keyword not supported: 'fulluri'。
- AndezSqliteConnection
是来自不同的包 Microsoft.Data.Sqlite
,它不支持 FullUri 参数。 - ghord
var connection = new SqliteConnection("Filename=:memory:");
- Skorunka František