简体   繁体   English

是否可以连接到在程序外部创建的内存中Sqlite数据库?

[英]Is it possible to connect to a in-memory Sqlite database created external to the program?

If I create a in-memory database from command line, ie with the command 如果我从命令行(即使用命令)创建内存数据库

ATTACH :memory: as inMemoryDb

Is it possible to connect to this database from a C# application? 是否可以从C#应用程序连接到该数据库?

What would be the connection string? 连接字符串是什么?

As Shawn said, An in-memory database can only be accessed by the process that creates it. 正如Shawn所说,内存数据库只能由创建它的进程访问。 If you want multiple processes to use the same database, it has to be a file-based one. 如果要多个进程使用同一个数据库,则它必须是基于文件的数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM