tags:

views:

42

answers:

2
A: 

You can get the specific reason if instead of insert() you use insertOrThrow() and catch the exception, then the error message should help you figure out the reason quickly.

totramon
Hi,Guys ,Thanks a lot for helping me to find the error, finally insertOrthrow() get me the error, this is the error that i got,08-20 17:07:18.281: ERROR/SimpleDBAdapter(201): android.database.sqlite.SQLiteException: near "Status": syntax error: , while compiling: INSERT INTO SimpleTable1(Name, Maritual Status, Designation, Date of Joining) VALUES(?, ?, ?, ?);Any knowledge about this error guys?
Nandagopal T
Any Help Appreciated ,Thanks in Advance...
Nandagopal T
Thanks totramon for helping me find that error, your approach and MrThys advice helped me to find out that error,because before that i could n't find even where the error was... Now atleast i can find out location of the error..! Thanks Guys...
Nandagopal T
Hurrah ! I fixed that error,now the values get inserted in to table Thanx MrThys, what u have mentioned is right, thanx for notifying my mistake.Keep Helping..Guys.....
Nandagopal T
A: 

As I can see so far, your ContentValues keys are not the same as the column names, which should be as I recall.

So your constants would have to become;

private static final String KEY_EMPLOYEE_ID = "Employee_ID";
private static final String KEY_EMPLOYEE_NAME = "Employee_Name";
private static final String KEY_EMPLOYEE_DESIGNATION = "Designation";
private static final String KEY_EMPLOYEE_MARITUALSTATUS = "Maritual_Status";
private static final String KEY_EMPLOYEE_DOJ = "JoinedDateTime";

if that doesn't solve your problem, try to post the stacktrace, so that we have more details to help you.

MrThys
Indeed, if nothing else fails, that should.
totramon