mardi 3 mars 2015

how to get text field in database in this code?

i have a database consist of 4 filed that one of them is Text, now i want by use is query get Text filed and show in TextView , how should i do it? Please help me!


my source code :





value = getIntent().getStringExtra("position");

Load_Database();
db = myDbHelper.getReadableDatabase();



Cursor c = db.rawQuery("select text from movie_list where name = '"+value+"'" , null);

????????


private void Load_Database() throws Error {
myDbHelper = new MovieDB(DisplayActivity.this);
try {

myDbHelper.createDataBase();

} catch (IOException ioe) {

throw new Error("Unable to create database");

}

try {

myDbHelper.openDataBase();
} catch (SQLException sqle) {
throw sqle;

}

}

Aucun commentaire:

Enregistrer un commentaire