lundi 29 décembre 2014

use SQLite in windows CE wrote by C#

I made an app for my PDA and use SQLite as database. I did it as below:



  1. Added System.Data.SQLite.dll to my REFERENCE

  2. Added SQLite.Interop.066.DLL , SQLite.Interop.066.exp , SQLite.Interop.066.lib to solution

  3. Called ref with using System.Data.SQLite;


and my connection string and command string is:



SQLiteConnection con = new SQLiteConnection("Data Source=BSTDB.sqlite;Version=3");
string sqlwrite = "INSERT INTO RR (Serial) VALUES('"+cBox1.Text+"')";
SQLiteCommand cmdwrite = new SQLiteCommand(sqlwrite, con);
con.Open();
cmdwrite.ExecuteNonQuery();
con.Close();


But when I start program, this error occurs:



SQLite error no such table:



Can anyone guide me what is my problem?


Meanwhile, this app is working correct on Windows 7 now.


Aucun commentaire:

Enregistrer un commentaire