Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to return string from sqlite by using 2 string argument?
    primarykey
    data
    text
    <p>here is my code for using that string</p> <pre><code>String item = item1.getText().toString(); item = item.toLowerCase(); String date = getDate(); Datahelper edited = new Datahelper(this); edited.open(); String returnedprice = edited.getprice(item,date); String returneddetail = edited.getdetail(item,date); edited.close(); price.setText(returnedprice); details.setText(returneddetail); </code></pre> <p>and this is my method in sqlite</p> <pre><code>public String getprice(String item ,String date) { // TODO Auto-generated method stub String[] columns = new String[]{KEY_ROWID, KEY_CATEGORY,KEY_DATE,KEY_PRICE,KEY_DETAILS}; String whereClause = KEY_CATEGORY + " = ? and " + KEY_DATE + " = ?"; String[] whereArgs = {item,date}; Cursor c = ourDatabase.query("DATABASE_TABLE", columns, whereClause, whereArgs, null, null, null); if(c!=null){ String price = c.getString( c.getColumnIndex(KEY_PRICE)); return price; } return null; } public String getdetail(String item, String date) { // TODO Auto-generated method stub String[] columns = new String[]{KEY_ROWID, KEY_CATEGORY,KEY_DATE,KEY_PRICE,KEY_DETAILS}; String whereClause = KEY_CATEGORY + " = ? and " + KEY_DATE + " = ?"; String[] whereArgs = {item, date}; Cursor c = ourDatabase.query("DATABASE_TABLE", columns, whereClause, whereArgs, null, null, null); if(c!=null){ String detail = c.getString( c.getColumnIndex(KEY_DETAILS)); return detail; } return null; } </code></pre> <p>my app gets crash when using this code,, i dont know waht's wrong in the code if anyone need i can post the whole code pls help me</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload