schotime / NPoco

Simple microORM that maps the results of a query onto a POCO object. Project based on Schotime's branch of PetaPoco
Apache License 2.0
847 stars 301 forks source link

SQLite Insert Error : SQL logic error unrecognized token: @ #689

Open maxbrugnerotto opened 1 year ago

maxbrugnerotto commented 1 year ago

Hi Any Insert command into SQLite database generate a run time error: SQL logic error unrecognized token: @ If I use a MySQL database the insert command run successfully

Code example: string SQLiteDatabase = @"C:\Temp\FileEspresso.db"; SQLiteConnection sqliteConn = new SQLiteConnection("Data Source=" + SQLiteDatabase + ";Version=3"); sqliteConn.Open(); db = new NPoco.Database(sqliteConn, DatabaseType.MySQL); Category cat = new Category(0, 1, "XXXXX TEST-1- XXXXX"); db.Insert(cat); // <-- Run time error here!!! db.CloseSharedConnection();

NPocoTest.zip Attached here a sample application (copy SQLite sample database file FileEspresso.db into folder C:\Temp)

Many thanks and best regards