Asyc reader in .NET 2

  • Thread starter Thread starter Smokey Grindle
  • Start date Start date
S

Smokey Grindle

Is it possible to process data as it is pulled back in asyc mode? I want to
process records as they come back from the SQL Server basically and convert
them to local objects... which right now takes a lot of time doing it like
this

Load data table from SQL Reader
Loop through each data row
create object based on data row
End loop
Return collection of objects

I thought it would be neat to do it like this
Async Load of data from SQL Reader
Async returned a row, convert to object (1 per row)
Wait For Async to end (WaitOne basically)
Return collection

is this possible? if so how? thanks!
 
Ah, async ops in ADO.NET are only async in the query portion of the
task--all of the rows are returned synchronously.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
ah ok, was hoping I could eliminate a bottleneck in returing a large data
set by doing it async... oh well, guess now all I can do is execute multiple
requests at once :)
 
Back
Top