hello, i use sqlite for populate spinner for my project, i need to update the element stored in database, for populate i use this code:
example in txtmenu i write: Spaghetti and txtcaricoeuro i write: 6.00
with spmn9.add i added: spaghetti - Euro 6.00
with thi code i load the spinner with all data stored:
Now i need to modify one element loaded in this spinner.
example: Spaghetti - euro 6.00 updated with Spaghetti - Euro 7.50
what code should i use to modify this element?
for delete element i use:
for update or modify this element without delete?
B4X:
dbSQL.ExecNonQuery2("INSERT INTO field9 VALUES (?)", Array As String(txtmenu.Text & " - " & "Euro" & " " & txtcaricoeuro.Text))
spmn9.Add (txtmenu.Text & " " & "Euro" & " " & txtcaricoeuro.Text)
txtcaricoeuro.Text=""
dbCursor.Close
txtmenu.Text=""
example in txtmenu i write: Spaghetti and txtcaricoeuro i write: 6.00
with spmn9.add i added: spaghetti - Euro 6.00
with thi code i load the spinner with all data stored:
B4X:
Sub mn9
spmn9.Clear
dbCursor = dbSQL.ExecQuery("SELECT * FROM field9")
For I = 0 To dbCursor.RowCount - 1
dbCursor.Position = I
spmn9.Add(dbCursor.GetString("data9"))
Next
dbCursor.Close
End Sub
Now i need to modify one element loaded in this spinner.
example: Spaghetti - euro 6.00 updated with Spaghetti - Euro 7.50
what code should i use to modify this element?
for delete element i use:
B4X:
dbSQL.ExecNonQuery2("DELETE FROM field9 WHERE data9 = ?", Array As String(spmn9.SelectedItem))
for update or modify this element without delete?