* Downloaded http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki from sqlite-netFx35-setup-bundle-x86-2008-1.0.83.0.exe
* Install vs2008. During the installation process, some errors are prompted on the console interface, and the installation is complete.
* Create a new C # project in vs2008, "Add references..." browse to the sqlite-netFx35-setup-bundle-x86-2008-1.0.83.0.exe installation directory
* For example, my installation directory: D: \ Program Files \ system. Data. SQLite \ 2008 \ bin
* Select system. Data. SQLite. dll. In the project references, you can see that there is one more: system. Data. SQLite.
* Add using system. Data. SQLite in form1.cs of the project;
* AddedCodeAs follows:
* After the compilation and debugging are passed, the cause of the problem is that the csdner's. Net version is incorrect, resulting in a pass-through test the day before yesterday.
Using system. data. SQLite; namespace testusesqlite {public partial class form1: FORM {private string datasource = "contactbookdb. SQLite "; Public form1 () {initializecomponent (); sqliteconnection. createfile (datasource); sqliteconnection dbconn = new sqliteconnection ("Data Source =" + datasource); dbconn. open (); sqlitecommand dbcmd = dbconn. createcommand (); dbcmd. commandtext = "create table telephonebook (personid varchar (20), telephone varchar (30), type varchar (20)"; dbcmd. executenonquery (); dbcmd. commandtext = "insert into telephonebook values ('mtb', '000000', 'not mobile')"; dbcmd. executenonquery (); dbcmd. commandtext = "select * From telephonebook"; sqlitedatareader datareader = dbcmd. executereader (); datatable = new datatable (); If (datareader. hasrows) {datatable. load (datareader);} datagridview1.datasource = datatable; datareader. close (); dbconn. close ();}}}