vendredi 23 janvier 2015

Insert value to specific primary key in sqlite , android?

I have to below table structure of my sqlite database in android


Table Strucre


I want to insert value to "answer" column according to the ques id.


How do I do it?



SQLiteDatabase db = this.getWritableDatabase();

ContentValues values = new ContentValues();
values.put(KEY_Answer, answer);
// Inserting Row
db.insert(TABLE_Question, null, values);

db.close(); // Closing database connection

Aucun commentaire:

Enregistrer un commentaire