如何使用c#操作SQLite数据库

    技术2022-05-20  33

    1. http://sourceforge.net/projects/sqlite-dotnet2/files/ 下载ADO.NET provider for the SQLite database engine. 然后安装。

    2. VS 2005 新建控制台程序,然后添加引用System.Data.SQLite.dll,该文件在ADO.NET provider for the SQLite 安装目录的bin目录下。

    3. using 该命名空间,就可以和使用其他ADO.NET Provider一样使用它了。

     

    代码如下:

    SQLiteConnection cn = new SQLiteConnection("Data Source=E://user.db")

    链接数据库使用上面的代码,格式:盘符://数据库文件名

    剩下的可以自己写了


    最新回复(0)