1、在NuGet中搜索System.Data.SqLite.Core,下载SQLite数据库引擎:
2、在配置文件中添加连接字符串:
<connectionStrings> <add name="DB" connectionString="data source=.\DB\DB.db;version=3;"/> </connectionStrings>
3、使用:
string ConnectionString = ConfigurationManager.ConnectionStrings["DB"].ConnectionString; using (IDbConnection conn = new SQLiteConnection(ConnectionString)) { }
原文:https://www.cnblogs.com/li-guojiang/p/15167711.html