引入命名空间
using System.Data.Linq;
using Mono.Data.sqlite;
编写代码
var conn = new sqliteConnection(ConfigurationManager.AppSettings["dbstring2"]);
var db = new DataContext(conn);
List<Test> obj = db.ExecuteQuery<Test>("select * from test").ToList();
Console.WriteLine(obj.Count);
dbstring2格式:
<add key="dbstring2" value="DbLinqProvider=qlite;Data Source=C:\Users\darren\Downloads\sqliteSpy_1.9.11\mytest.db3"/>