Hi all, I am a very newbie so forgive my ignorance but I am trying to learn.
I am trying to populate a spinner control with values from an sqllite db.
Here is the structure of my db.
Name:test.db
1 table named customers
6 fields named:
id
name
street
city
state
zip
Here is my code. When I run the debugger, it gives me a "customer table not found" error.
I know it is something stupid on my part but I can't figure it out.
I am trying to populate a spinner control with values from an sqllite db.
Here is the structure of my db.
Name:test.db
1 table named customers
6 fields named:
id
name
street
city
state
zip
Here is my code. When I run the debugger, it gives me a "customer table not found" error.
I know it is something stupid on my part but I can't figure it out.
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Invoice")
If File.Exists(File.DirRootExternal, "test.db") = False Then
File.Copy(File.DirAssets, "test.db", File.DirRootExternal, "test.db")
End If
SQL1.Initialize(File.DirRootExternal, "test.db", True)
PopulateSpinner
End Sub
Sub PopulateSpinner
dbCursor = SQL1.ExecQuery("SELECT id FROM customers")
For I = 0 To dbCursor.RowCount - 1
DoEvents
dbCursor.Position = I
spnId.Add(dbCursor.GetString("id"))
Next
End Sub
Last edited: