使用mono.data.sqlite+EF进行开发

引入命名空间

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"/>

使用DataContext操作SQLite详细步骤

http://wenku.baidu.com/link?url=LMK83pIPGHefblNqouEyoCz5EidZ6tIPFRWrDeZU9DFR4up7FCi475QJ7WsDfmk-qXGZookvcMpDhEVWpdy5LFb1ss08vG72xHz256yy9qu

大道至简

posted @ 2022-12-03 09:09  星火燎猿*  阅读(3)  评论(0编辑  收藏  举报