Posts

Showing posts with the label android-sqlite

Dissplay result sqlite query in textview

Dissplay result sqlite query in textview I tried to calculate a report and displays the result in the texview "edt1". But it's not displayed. there is mydatabasehelper : public void calculrapport(Argent a) { db = this.getWritableDatabase(); String query = "select sum(Entree) from Argent where date between "datedebut" and "datefin" ;"; Cursor cursor = db.rawQuery(query , null) ; int count = cursor.getCount(); } There is my class Rapport.java : public void onOKClick ( View v ) { if (v.getId() == R.id.okrapport) { EditText datedebut = (EditText) findViewById(R.id.datedebut); EditText datefin = (EditText) findViewById(R.id.datefin); String strdatedebut = datedebut.getText().toString(); String strdatefin = datefin.getText().toString(); Argent a = new Argent(); helper.calculrapport(a); edt1.setText( ); } } Thanks in advance. 1 Answe...

SQLite - UPDATE syntax error

SQLite - UPDATE syntax error db.execSQL("UPDATE" +JournalContract.JournalEntry.TABLE_NAME +"SET"+ JournalContract.JournalEntry.COLUMN_DATE + = date +JournalContract.JournalEntry.COLUMN_TITLE + = title + JournalContract.JournalEntry.COLUMN_CONTENT+ =content + JournalContract.JournalEntry.COLUMN_HOUR+ = time +" WHERE _ID='" + id + "'"); Please i would like someone to verify the syntax. UPDATE should have a space after it also other keywords . Apart from that why don't you just log the query to check . – ADM Jul 1 at 15:42 UPDATE By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy,...