Hej, jestem początkującym Androidianem i chciałbym w tym pomóc?Android :: SQLite, nie znaleziono takiej kolumny?
android.database.sqlite.SQLiteException: Nie ma takiego kolumna: asd:, podczas kompilacji: DELETE FROM etykiet WHERE name = asd
Jest to błąd am licowa, a oto kod:
to jest to metoda w DBhelper:
/**
* Delete a label table
* */
public void deleteLabel(String label) {
SQLiteDatabase db = this.getWritableDatabase();
// ContentValues values = new ContentValues();
// values.remove(label);
// Deleting Row
db.delete(TABLE_LABELS, KEY_NAME + "=" + label, null);
db.close(); // Closing database connection
}
i tu jest główny kod aktywny że wywołania metody:
// 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();
}
});
Dziękuję bardzo, działa teraz. – Tayseer
Czy możesz to sprawdzić, jeśli potrafisz: http://stackoverflow.com/questions/13178056/android-get-data-from-another-activity – Tayseer
The '' jest zabójcą czasu – playmaker420