Hi All,
See the Android program to insert into SQLite DB.
NB: Here the values can be taken from text boxes using getText() function instead of 'HUP' and 'TAFTKTU'
See the Android program to insert into SQLite DB.
public void hup(View abc)
{
SQLiteDatabase hupdb;
hupdb=this.openOrCreateDatabase("hup", MODE_PRIVATE, null);
hupdb.execSQL("CREATE TABLE IF NOT EXISTS REGISTRATION(username text,password text)");
hupdb.execSQL("insert into registration values('HUP','TAFTKTU')");
Toast.makeText(this, "Data Inserted HUP", Toast.LENGTH_LONG).show();
hupdb.close();
}
SQLiteDatabase hupdb;
hupdb=this.openOrCreateDatabase("hup", MODE_PRIVATE, null);
hupdb.execSQL("CREATE TABLE IF NOT EXISTS REGISTRATION(username text,password text)");
hupdb.execSQL("insert into registration values('HUP','TAFTKTU')");
Toast.makeText(this, "Data Inserted HUP", Toast.LENGTH_LONG).show();
hupdb.close();
}
NB: Here the values can be taken from text boxes using getText() function instead of 'HUP' and 'TAFTKTU'
No comments:
Post a Comment