I have this error: table contact has no column named time (code 1): , while compiling: INSERT INTO contact(time,day,status) VALUES (?,?,?) at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method please help me if you know the solution.
my code is :
public void onCreate(SQLiteDatabase db)
{
db.execSQL("CREATE TABLE " + TABLE_CONTACTS + "(" + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_TIME + " TEXT," + KEY_STATUS + " TEXT," + KEY_DAY + " TEXT)");
}
and I add data in this way:
button6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String A="aa";
String B="bb";
String C="cc";
Contact contact = new Contact(0,A, B ,C);
try {
dbHandler.createContact(contact);
} catch (Exception e) {
Log.e("ERROR", "ERROR IN CODE: " + e.toString());
}
});
Aucun commentaire:
Enregistrer un commentaire