mardi 6 janvier 2015

here is my code it seareches by Rowid but i want it to search using string plss help me


public String getstation(long l) throws SQLException{
// TODO Auto-generated method stub
String[] columns=new String[]{KEY_ID,KEY_STATION,KEY_BUS,KEY_TIME};
Cursor c= db.query(DATABASE_TABLE, columns, KEY_ID + "=" + l , null, null, null, null);
if(c != null)
{c.moveToFirst();
String station=c.getString(1);
return station;
}
return null;
}


the above code searches a station using row id but i want it search using a string..,and it also return two more details..my project outline is if we type a name it should display the name,rollnumber,and time of joining...my database searches using the row id i want by app to search the database using the name passed..please help me guys


Aucun commentaire:

Enregistrer un commentaire