Hi everyone, I'm new to Android simulator and would like to help with this?
android.database.sqlite.SQLiteException: there is no such column: asd :, at compilation: DELETE FROM labels WHERE name = asd
this is the error facing, and here is the code:
this is the method in DBhelper:
public void deleteLabel(String label) { SQLiteDatabase db = this.getWritableDatabase();
and here is the main operation code calling the method:
// for spinner onItemListener // and here is what label is final String label = parent.getItemAtPosition(position).toString(); Button dialogDeletelButton = (Button) dialog .findViewById(R.id.deleteButton); dialogDeletelButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // database handler DatabaseHandler db = new DatabaseHandler( getApplicationContext()); // inserting new label into database db.deleteLabel(label); // Hiding the keyboard InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(inputLabel.getWindowToken(), 0); // loading spinner without the deleted data loadSpinnerData(); } });
source share