I don't understand threads well but I think this is what you want
Got it from threading demo
Sub ThreadSub2
Dim Count As Int
Dim Params(1) As Object
Do While Count < 1000
' instead of locking like Thread1 we could crudely just wait for the GUI to update
' some messages may be lost but this may not matter in some applications
Count = Count + 1
Params(0) = Count
Thread2.RunOnGuiThread("Update2", Params)
Thread2.Sleep(10)
Loop
End Sub
Sub Update2(count As Int)
EditText2.Text = count
ProgressBar1.Progress = count /10
Lock2.Unlock
End Sub
I don't understand threads well but I think this is what you want
Got it from threading demo
Sub ThreadSub2
Dim Count As Int
Dim Params(1) As Object
Do While Count < 1000
' instead of locking like Thread1 we could crudely just wait for the GUI to update
' some messages may be lost but this may not matter in some applications
Count = Count + 1
Params(0) = Count
Thread2.RunOnGuiThread("Update2", Params)
Thread2.Sleep(10)
Loop
End Sub
Sub Update2(count As Int)
EditText2.Text = count
ProgressBar1.Progress = count /10
Lock2.Unlock
End Sub
Thanks for the quick reply Sir,
But for me this code is not sufficient... iam using below given function to fetch the data from mssql
i know its a long method but i dont know another way to fetch data the same and insert into amy local sqlite database.. it takes too much time...
but it is fetching data for me.... Now including this function i want to add a progressbar so that i know how much data will be fetched..
Sub UPPER1
SQL1.ExecNonQuery("delete from TAB_TEAM ") 'the table in my local database
Dim L1 As List
Dim L2 As List
Dim L3 As List
Dim L4 As List
Dim L5 As List
Dim L6 As List
Dim L7 As List
Dim L8 As List
Dim L9 As List
Dim L10 As List
Dim L11 As List
Dim L12 As List
Dim col1 As String
Dim col2 As String
Dim col3 As String
Dim col4 As String
Dim col5 As String
Dim col6 As String
Dim col7 As String
Dim col8 As String
Dim col9 As String
Dim col10 As String
Dim col11 As String
Dim col12 As String
Dim i As Int
L= a.Query("select ID from FS WHERE LC = " &Login.TEXT & "")
For i = 1 To L.Size -1
Msgbox(i,"record")
L1= a.Query("select fsid from FS WHERE LC = " &Login.TEXT & "")
col1 = L1.Get(i)
col1 = col1.Replace("[","").Replace("]","").Replace(",","").Replace("FSID","")
L2= a.Query("select Name from FS WHERE LC = " &Login.TEXT & "")
col2 = L2.Get(i)
col2 = col2.Replace("[","").Replace("]","").Replace(",","").Replace("Name","")
L3= a.Query("SELECT DESIGNATION FROM FS where [lc] = "& Login.TEXT &"")
col3 = L3.Get(i)
col3 = col3.Replace("[","").Replace("]","").Replace(",","").Replace("Designation","")
L4= a.Query("SELECT HQ FROM FS where [lc] = "& Login.TEXT &"")
col4 = L4.Get(i)
col4 = col4.Replace("[","").Replace("]","").Replace(",","").Replace("HQ","")
L5= a.Query("SELECT Division FROM FS where [lc] = "& Login.TEXT &"")
col5 = L5.Get(i)
col5 = col5.Replace("[","").Replace("]","").Replace(",","").Replace("Division","")
L6= a.Query("SELECT Statename FROM FS where [lc] = "& Login.TEXT &"")
col6 = L6.Get(i)
col6 = col6.Replace("[","").Replace("]","").Replace(",","").Replace("Statename","")
L7= a.Query("SELECT MobileNO FROM FS where [lc] = "& Login.TEXT &"")
col7 = L7.Get(i)
col7 = col7.Replace("[","").Replace("]","").Replace(",","").Replace("MobileNO","")
L8= a.Query("SELECT RPTO FROM FS where [lc] = "& Login.TEXT &"")
col8 = L8.Get(i)
col8 = col8.Replace("[","").Replace("]","").Replace(",","").Replace("RPTO","")
L9= a.Query("SELECT RPTOID FROM FS where [lc] = "& Login.TEXT &"")
col9 = L9.Get(i)
col9 = col9.Replace("[","").Replace("]","").Replace(",","").Replace("RPTOID","")
L10= a.Query("SELECT DOB FROM FS where [lc] = "& Login.TEXT &"")
col10 = L10.Get(i)
col10 = col10.Replace("[","").Replace("]","").Replace(",","").Replace("DOB","")
L11= a.Query("SELECT EMAIL FROM FS where [lc] = "& Login.TEXT &"")
col11 = L11.Get(i)
col11 = col11.Replace("[","").Replace("]","").Replace(",","").Replace("EMAIL","")
L12= a.Query("SELECT lvl FROM FS where [lc] = "& Login.TEXT &"")
col12 = L12.Get(i)
col12 = col12.Replace("[","").Replace("]","").Replace(",","").Replace("LVL","")
SQL1.ExecNonQuery("INSERT INTO TAB_TEAM VALUES(" & col1 & ", '" & col2 & "', '" & col3 & "', '" & col4 & "', '" & col5 & "', '" & col6 & "', '" & col7 & "', '" & col8 & "', " & col9 & ", '" & col10 & "', '" & col11 & "', " & col12 & ")")
Next
End Sub