SharePoint - Share Your Point!

ASP.NET & SharePoint 开发

导航

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

Posted on 2009-11-19 17:36  SharePoint-ShareMyPoint  阅读(911)  评论(0编辑  收藏  举报

前面的文章已经介绍了SQLite数据库和ADO.NET Provider for SQLite, 现在介绍下如何使用c#操作SQLite数据库。

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一样使用它了。

 

代码如下:

 

Code

 

 

运行结果:

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword

cola---mypassword