1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4J Question how to load table values to spinner

Discussion in 'B4J Questions' started by Makumbi, Jun 15, 2019.

  1. Makumbi

    Makumbi Active Member Licensed User

    Please help how can i modify this spinner to load these :
    S1,S2,P1,P2

    Code:
    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
     
  2. mangojack

    mangojack Well-Known Member Licensed User

    What is S1, S2, P1, P2. ??
     
  3. Makumbi

    Makumbi Active Member Licensed User

    They are the values in the table classes
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice