From User's Guide, 4) SQLite Database
I am using the example wrote for Klaus also the DB: "persons" but I have changed many thing because
I want to read a specific data then show it in an EditText, How could I do it?
Using the code below, I got this error:
"An error has occurred in sub:
Android.database.sqlite.SQLiteException: no such tableersons(Code1):,while compiling:
SELECT*FROM persons
Conitnue?"
I am using the example wrote for Klaus also the DB: "persons" but I have changed many thing because
I want to read a specific data then show it in an EditText, How could I do it?
Using the code below, I got this error:
"An error has occurred in sub:
Android.database.sqlite.SQLiteException: no such tableersons(Code1):,while compiling:
SELECT*FROM persons
Conitnue?"
B4X:
Sub Button1_Click
'Dim i As Int
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT * FROM persons")
'Cursor1 = SQL1.ExecQuery("SELECT * FROM personas WHERE FirstName = ?")
Cursor1.Position = 3 'example location3 'set the cursor
EditText3.Text = Cursor1.GetString("FirstName") 'read the value of the FirstName column
'EditText4.Text = Cursor1.GetString("LastName") 'read the value of the LasstName column
'edtCity.Text = Cursor1.GetString("City") 'read the value of the City column
Cursor1.Close
End Sub
Attachments
Last edited: