jeudi 28 mai 2015

Sql search statement always retruning empty even when there is data in database in android

I am using the following to fetch a string from my table. The cursor is always returning empty even when I have data in database. Is the query wrong?

 String[] thecolumns = new String[]{
            ID,
            FLAG};

cursor = sqlDb.query(MY_TABLE,
            thecolumns, NUMBER + "='"
                    + myNumber + "'", null, null, null, null);

 if (cursorToFetchAssets != null   ) {

        cursorToFetchAssets.moveToFirst();{
try{
//code to fetch

}catch{
    //return when there are no rows found. 

   }

Aucun commentaire:

Enregistrer un commentaire