android - query method in SQLiteDatabase -
i want know how use query method have where clause like property. want select columns c_name column keyword.
i've tried this, doesn't work:
cursor = db.query(table, null, c_name, new string[] {"like '"+keyword+"'"}, null, null, null);
look @ docs. say:
selection filter declaring rows return, formatted sql clause (excluding itself). passing null return rows given table. so try this:
cursor = db.query(table, c_name, new string[] {c_name + " '" + keyword + "'"}, null, null, null); also see answer see examples on how use selectionargs (4th argument above). keyword have go.
Comments
Post a Comment