473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

asyncronous methods in asp.net 1.1

Hey

I have a question regarding a problem with binding a async result set 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

Dec 20 '05 #1
0 729

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ivar | last post by:
Hi, Is SocketOptionName.ReciveTimeout usable with asyncronous socket methods ? With Recive method it works but BeginRecive can't get it working.
0
by: Andrés Joaquín | last post by:
Hello, I have a problem with a TCP Asyncronous Server Implementation. I take the solution from the Microsoft Site (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
1
by: Nathan | last post by:
On my .NET web project I am trying to make an asyncronous call to a function using IAsyncResult. The function will process for about a 1/2 hour. before it completes, the process abruptly ends as...
1
by: alex002 | last post by:
Dear all, I am writing to a C# program to connect to the telnet server and getting data; however, I know that I can use either TCPClient and Asyncronous Socket to do the program. However, I...
0
by: Paul Fi | last post by:
what is the point of asyncronously processing requests or responses at channel sinks when we can do asyncronous calls at the .net remoting application level ? do we consider AsyncProcessResponse...
1
by: il RicercatoreSbadato | last post by:
title: asyncronous Socket and EndAccept() question: hi to all, I am working with a server that uses the sockets in a asyncronous way. When I want to STOP the server I do the following: -...
1
by: Allan Ebdrup | last post by:
I'm inside a function where I have a static cache, when the cache needs to be updated I want to do it asyncronously, because updating the cache takes a while. I want to use thread safety when...
0
by: Andrea Moro | last post by:
I've implemented the asyncronous mechanism in the webservice I've built, but there is a strange fact. The object that my callback class returns doesn't reflect any of the changes that I made in...
1
by: Marty Cruise | last post by:
I'm launching a second form as part of a background task (VB.Net 2005). All is good until that second form's procedure is done and then it seems to hang...the form does respond to the call to...
3
by: OJ | last post by:
Hi, I have written a small C# 2.0 DLL which acts as a client to a Socket based server over the internet. I have written both synchronous and asynchronous methods to connect, send, and receive data...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.