B4J Question how to load table values to spinner

Makumbi

Well-Known Member
Licensed User
Please help how can i modify this spinner to load these :
S1,S2,P1,P2

B4X:
Sub InitSpinners
Private i As Int
Private Query1 As String
    Private Curs As Cursor
'query = "CREATE TABLE SMSlist (Account Text, Names Text,Phone text,Sex, ID INTEGER )"
'We execute a query for each column and fill the Spinner
'We use SELECT DISTINCT to have each existing first name in the database only once
Query1 = "SELECT DISTINCT Class FROM Classes ORDER BY Class ASC"
Curs = SQL1.ExecQuery(Query1)
'we add 'no filter' as no selection
spinner1.Clear
spinner1.Add("Select from the List...")
    spinner1.add
'we fill the Spinner with the data from the database
For i = 0 To Curs.RowCount - 1
    Curs.Position = i
    'spnFirstName.Add(Curs.GetString("Account"))
    spinner1.Add(Curs.GetString("Years"))
        
    'Dim kk As String = Curs.GetString("Names")
    'Log(kk)
Next
'spnFirstName.RemoveAt("Select from the List...")
Curs.Close
End Sub
 

mangojack

Expert
Licensed User
Longtime User
Upvote 0
Top