android - syntax error while compiling SQLite DB (creating a table) whats wrong with my query? -
public void oncreate(sqlitedatabase db) { string query = "create table " + table_info + "(" + column_id + " integer primary key " + column_date + " text " + column_docname + " text " + column_symp + " text " + column_digno + " text " + column_meds + " text " + ");"; db.execsql(query);
what wrong this? getting androidruntime:
fatal exception: main android.database.sqlite.sqliteexception: near "date": syntax error: , while compiling: create table info(_id integer primary key date text docname text symp text digno text meds text );
error.
please help
you have comma missing in query after each column, change query string below:
string query = "create table " + table_info + "(" + column_id + " integer primary key, " + column_date + " text, " + column_docname + " text, " + column_symp + " text, " + column_digno + " text, " + column_meds + " text " + ");";
Comments
Post a Comment