B4J Question Problem with Resultset in Mssql

I have a problem with this code
show me this error ?What should I do?
lblCode.Text=readFrompazireshCount
 
Last edited:

aeric

Expert
Licensed User
Longtime User
B4X:
Wait For (ConnectiontoSQL) Complete (Success As Boolean)
If Success Then
    lblCode.Text = ReadFromPazireshCount
End If

Sub ConnectiontoSQL As ResumableSub
    SQL1.InitializeAsync("MSSQL", "net.sourceforge.jtds.jdbc.Driver", $"jdbc:jtds:sqlserver://${DBLocation}/${DatabaseName}"$, DBUsername, DBPassword)
    Wait For MSSQL_Ready (Success As Boolean)
    Log(Success)
    If Success = False Then
        Log(LastException)
        Return False
    End If
    Return True
End Sub

Sub ReadFromPazireshCount As String
    Dim value As String
    Dim rs As ResultSet = SQL1.ExecQuery("SELECT * FROM paziresh")
    Do While rs.NextRow
        value = rs.GetString2(0)
    Loop
    rs.Close
    Return value
End Sub
 
Upvote 0