Re: I am having trouble with the async operation of the interface [sqlwinrt:4...

Dec 16, 2013 at 8:58 PM
Hi Andy ,
I have some progress but still have some problems.
I have continually gotten an error code 5 which when I look it up says that database is busy ,
This is happening on an update to the data base. When I start the page I perform a open and then a read and all is well , I am running the update off of a button.
I keep getting this same error at times and cannot figure out what is happening.
Do you know why I would be getting a error code 5
Thanks,
Jerry
------------------------------------------------------------------------------------------------ update
Dim stmt3 As Statement
Try
stmt3 = Await db.PrepareStatementAsync(myQuery)
With PropertyManager(iyear)

stmt3.BindDoubleParameterAt(1, .Income)
stmt3.BindDoubleParameterAt(2, .OperatingExpenses)
stmt3.BindDoubleParameterAt(3, .Maintenance)
stmt3.BindDoubleParameterAt(4, .TaxOther)
stmt3.BindDoubleParameterAt(5, .Commission)
stmt3.BindDoubleParameterAt(6, .NOI)
stmt3.BindDoubleParameterAt(7, .DebtService)
stmt3.BindDoubleParameterAt(8, .CashFlow)
End With

stmt3.BindIntParameterAt(9, rowid)
stmt3.BindIntParameterAt(10, iyear)

Await stmt3.StepAsync()

stmt3.Dispose()
Call CalcProp()

Return
Catch e1 As Exception
Dim result As Integer
result = Database.GetSqliteErrorCode(e1.HResult)
result = result

Return

End Try

End Try
------------------------------------------------------------------------------------------------------------- open
Private Async Sub LoadDatabase()

Dim localFolder As Windows.Storage.StorageFolder = Windows.Storage.ApplicationData.Current.LocalFolder

db = New Database(localFolder, "RealEstateProLite.sqlite")
Await db.OpenAsync(SqliteOpenMode.OpenReadWrite)
Call ReadYearlyManager()

End Sub
------------------------------------------------------------------------------------------------- read
Dim stmt3 As Statement
Try

stmt3 = Await db.PrepareStatementAsync(myQuery)

If (Await stmt3.StepAsync() = True) Then

With PropertyManager(iyear)
.Income = stmt3.GetDoubleAt(2)
.OperatingExpenses = stmt3.GetDoubleAt(8)
.Maintenance = stmt3.GetDoubleAt(7)
.TaxOther = stmt3.GetDoubleAt(9)
.Commission = stmt3.GetDoubleAt(10)
.NOI = stmt3.GetDoubleAt(4)
.DebtService = stmt3.GetDoubleAt(5)
.CashFlow = stmt3.GetDoubleAt(6)
End With
End If
stmt3.Dispose()
' Next

Call putText()

Call CalcProp()
Return
Catch e1 As Exception
Dim result As Integer
result = Database.GetSqliteErrorCode(e1.HResult)
result = result

Return

End Try
Return
End Sub
-----------------------------------------------------------------------------------------------------
In a message dated 12/13/2013 11:10:22 A.M. Eastern Standard Time, [email removed] writes:

From: andywigley

Oops – I screwed up. Thanks for the feedback.

I’ve just reverted a change I made that was made for the wrong reasons anyway. Please pull down the source again and hopefully you should have better luck this time.

Andy