Skip to content Skip to sidebar Skip to footer

Sqlitelog: (1) Near "produse": Syntax Error

I Want to add data from another class into my database and I get this errors: 'SQLiteLog: (1) near 'Produse': syntax error' and 'SQLiteDatabase: Error inserting Pret=102.0 Ingr

Solution 1:

You should not use whitespaces in your column names.

change

publicstaticStringCOLUMN_PRODUS="Nume Produse";

into

publicstaticStringCOLUMN_PRODUS="NumeProduse";

Solution 2:

When you want column with white space in sqlite you should use ``. Instead of:

INSERT INTO table (column, column two) values...

you should use:

INSERT INTO table (column, 'column two') values...

The same when you create table.

Post a Comment for "Sqlitelog: (1) Near "produse": Syntax Error"