B4J Question How To create Auto Number Using B4j

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

  1. Makumbi

    Makumbi Active Member Licensed User

    Please help me how i wanted to create an auto number for my ID colum in my Table AndroidUserdata but iam failing to implement it

    Code:
    Dim jtrb As HttpJob
            jtrb.Initialize(
    "", Me)
            jtrb.Download2(
    "http://kccug.com/KabojjaApp/HandlerVBLoadclass.ashx",Array As String("Action""jtr""customerId",ResultSet1.GetString2(0)))
            
    Wait For (jtrb) JobDone(jtrb As HttpJob)
            
    If jtrb.Success Then
                
    Log(jtrb.GetString)
            
    End If
            jtrb.Release
           
            
    Dim jt As HttpJob
            jt.Initialize(
    "", Me)
            jt.Download(
    "http://kccug.com/KabojjaApp/HandlerVBDisplayload.ashx")
            
    'j.GetRequest.Timeout = 1000 ' 10 seconds2
            Wait For (jt) JobDone(jt As HttpJob)
            
    If jt.Success Then ' if job is success (http status code 200)
                Dim RetVal As String
                RetVal = jt.GetString
           
                
    Dim jp As JSONParser
                jp.Initialize(jt.GetString)
                
    'Log(jp) ' will pr
                Dim quotes As List = jp.NextArray
                
    For Each quot As Map In quotes
                    
    Log("Phone: " & quot.Get("Phone"))
                    
    Log("Type: " & quot.Get("Type"))
                    
    Log("Class: " & quot.Get("class"))
                    
    Log("Stream: " & quot.Get("Stream"))
                    
    Log("Names: " & quot.Get("Names"))
                           
                   
                    
    Dim rst As ResultSet = SQL1.ExecQuery("SELECT DISTINCT ID FROM AndroidUserdata;" )
                
    '    Do While rs.NextRow
                    Dim row(1As Object
                       
                    row(
    1) = rst.GetString("ID")'
                        Dim NewID As Int
                        NewID =row(
    1) +1
                        SQL1.ExecNonQuery2(
    "INSERT INTO AndroidUserdata VALUES(?, ?, ?,?, ?,?)"Array As Object(quot.Get("Phone"), quot.Get("Names"), quot.Get("class") ,quot.Get("Stream"),quot.Get("Type"),NewID))
                                                                   
            jt.Release

                    
    'Loop
                    Next
                
    'jk.Release

                
    'Return
            End If
     
  2. inakigarm

    inakigarm Well-Known Member Licensed User

    Last edited: Jun 25, 2019
    DonManfred likes this.
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