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

来源:互联网 发布:java串口通信编程 编辑:程序博客网 时间:2024/05/16 15:36

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

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

剩下的可以自己写了

原创粉丝点击