asyncronous methods in asp.net 1.1
HeyI have a question regarding a problem with binding a async resultset to a
datagrid.
I have a sync function searchproducts, which i want to expose async.
It returns a custom collection object, but I get a object ref exception.....
my class:
-----------------------------------------------------------------
Private Delegate Function InvokeSearchProducts(ByVal searchString As String)
As ProductCollection
Private _deleg As InvokeSearchProducts
Private _ar As IAsyncResult
Private _canceled As Boolean
Public Function SyncSearchProducts(ByVal search As String) As
ProductCollection
'code............
End Function
Public Sub BeginSearchProducts(ByVal searchString As String)
_deleg = New InvokeSearchProducts(AddressOf SyncSearchProducts)
_ar = _deleg.BeginInvoke(searchString, Nothing, Nothing)
End Sub
Public Function EndSearchProducts() As Model.ProductCollection
If _canceled OrElse _deleg Is Nothing Then
Return Nothing
Else
Return _deleg.EndInvoke(_ar)
End If
End Function
-----------------------------------------------------------------
Can anyone help me with this?
Hope hearing from you
Greetings
dotdonk
