Try
SQL1.Initialize(File.DirInternal, "Masters.db", True)
Dim q As String = "SELECT Distinct * FROM tblLedgers WHERE PARTYNAME = '" & ddlaccname.Text & "' AND BDEPID = '" & GlobalConst.BDEPID &"' And CurFY = '" & GlobalConst.CurFY & "'"
tblLedgers = SQL1.ExecQuery(q)
If tblLedgers.RowCount > 0 Then
tblLedgers.Position= 0
Dim JsonFromDb As String = tblLedgers.GetString("PARTYJSON")
Dim OpeningBal As Double = tblLedgers.GetDouble("OPBAL")
ConvertJSONToDataTableinOFfflineMode(JsonFromDb, OpeningBal,True)
Else
Msgbox("No Data Found.", "Access Denied")
pbaccledger.Visible = False
ddlaccname.Enabled=True
txtFrom.Enabled=True
txtTo.Enabled=True
btnaccledger.Enabled=True
imgFrom.Enabled=True
imgTo.Enabled=True
End If
Catch
Log(LastException)
Msgbox(LastException, "Exception Occured")
End Try