How do I write Async methods..

  • Thread starter Thread starter Maersa
  • Start date Start date
M

Maersa

Hi All,

I've got a SqlDataReader which I need to loop through reading records and
there may be like 20,000 records - which ends up blocking the thread.
Can somebody show me how I can write an async methods for an operation like
this...

public void DataExport( SqlDataReader reader, Stream stream )
{
//--- go through reading the data and exporting it to the stream.
}

appreaciate your help..

thanks,
 
Thread worker = new Thread(new ThreadStart(DataExport));
Have the args pass as a member variables.
 
Back
Top