I have tried SQLiteConnection(":memory:")
and SQLiteConnection("sqlite::memory:")
but both of these fail with 'Invalid ConnectionString format'
How can I create an in memory sqlite database?
try
var connection = new SQLiteConnection("Data Source=:memory:");
This doesn't work for me. I get an exception 'The path is not of a legal form.' –
Autonomic
@Autonomic try not putting a space between Data Source => new SqliteConnection("DataSource=:memory:") –
Morganstein
var connection = new SqliteConnection("Filename=:memory:");
–
Creosote I'm using this:
var connectionStringBuilder = new SQLiteConnectionStringBuilder { DataSource = ":memory:" };
var connection = new SQLiteConnection(connectionStringBuilder.ToString());
Maybe it's too late, but FullUri=file::memory:?cache=shared;
is working.
Any more info? I get
System.ArgumentException : Keyword not supported: 'fulluri'.
using var connection = new SqliteConnection("FullUri=file::memory:?cache=shared;");
–
Architect @Andrez Lowercase
SqliteConneciton
you are using is from different package Microsoft.Data.Sqlite
which doesn't work with FullUri parameter. –
Piano © 2022 - 2024 — McMap. All rights reserved.