as an open-source database, SQLite has been widely used on iOS, Android, and other platforms. It is much more efficient than Microsoft's sqlce in terms of operating efficiency, you can compare the performance on the Internet.
reference blog:
http://www.cnblogs.com/egmkang/archive/2009/07/12/1521997.html
using SQLite on WM and installation:
1. first download and install the Program , some are the EXE installation package, some are the zip package, and some are the major files in the zip package.
decompress SQLite in the compareframework directory under the bin directory. the interop.066.dll file is stored in the corresponding project folder of the WM device or the WM simulator.
set the system in the bin directory. data. SQLite. load the DLL file to vs2008, that is, add reference. If a Windows Mobile project is developed, vs2008 should add the referenced system. Data. SQLite. dll file from the compareframework directory under the bin directory.
2. You also need an SQLite management tool. There are many management tools. I use sqlitespy_1.9.1.
3. Use the SQLite program as follows:
Code :
// Save dataset data to the SQLite database // The directory where the WM project is running string Path = path. getdirectoryname (system. reflection. assembly. getexecutingassembly (). getname (). codebase) + "\ test. db3 "; sqliteconnection conn = new sqliteconnection (" Data Source = "+ path); Conn. open (); sqlitecommand cmd = Conn. createcommand (); // The insert operation uses the transaction sqlitetransaction Tx = Conn. begintransaction (); cmd. transaction = TX; try {foreach (datarow row in DS. ta Bles ["users"]. rows) {string SQL = "insert into users (name, age) values ('" + row [0] + "', '" + row [1] + "') "; cmd. commandtext = SQL; cmd. executenonquery ();} Tx. commit (); MessageBox. show ("data inserted successfully !! ");} Catch (system. Data. SQLite. sqliteexception e) {Tx. rollback (); MessageBox. Show (" failed to insert data !! ");} Finally {Conn. close ();} ------------------------------------------------------------------------------ // insert data conn quickly. open (); string sql1 = "insert into users (name, age) values ('hello', 23)"; sqlitecommand cmd = new sqlitecommand (sql1, Conn); cmd. executenonquery (); -------------------------------------------------------------------------------- // read data and display try {string sql2 = "select * from users"; Conn. open (); sqlitedataadapter adapter = new sqlitedataadapter (sql2, Conn); datatable able = new datatable (); adapter. fill (datatable); datagrid1.datasource = datatable;} catch (exception e) {console. writeline (E. tostring ();} finally {Conn. close ();}