Android Question How to bind 'sql table Columns' to a list in B4A application

Shripal Dalal

Member
Licensed User
Longtime User
Hi guys,
I am new to b4a tool.
I am developing an app, where I want to just fetch data from sql and populate in a list. I have asp.net service which runs fine.
I searched many things here on the forum but unfortunately i didnt found any thread which can help me bind data. (I saw a thread showing hardcode bind of text and image). But i need to bind 'sql table columns'.
Please help me just how to bind fetched data to listView ??
any piece of code regarding FOR loop/cursor/while loop ???

thank you..
 
Last edited:

ronell

Well-Known Member
Licensed User
Longtime User
https://www.b4x.com/android/forum/t...using-httputils2-part-3-php-mysql-json.42663/

call a webservice and perform queries.. handle the result in jobdone event
B4X:
Dim job1 As HttpJob
    job1.Initialize("Fill", Me) 
    job1.Download2("https://home/yourwebservice.php")
    ProgressDialogShow2("Fetching Data...",False)

and fill your list/listview when the jobdone is raised
B4X:
Sub JobDone (Job As HttpJob)

    ProgressDialogHide
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
     
Select Job.JobName
           
Case "Fill"
        Dim strReturn As String
      
              strReturn = Job.Getstring

log(strReturn) '<-- result.. can be a string, array, or object
        

End Select

End Sub
 
Last edited:
Upvote 0
Top