I'm trying to convert some code that uses NReco.Data to async version of ExecuteReader (ExecuteReaderAsync) but the methods requires many parameters. Any ideas ?
This is the working code with no-async version of ExecuteReader is:
System.Data.DataSet ds = nreco_DbDataAdapter.Select(sql_query).ExecuteReader(
(rdr) =>
{
System.Data.DataSet ds = new System.Data.DataSet();
ds.Tables.Add(new NReco.Data.DataReaderResult(rdr).ToDataTable());
rdr.NextResult();
ds.Tables.Add(new NReco.Data.DataReaderResult(rdr).ToDataTable());
return ds;
}
);
Not sure what paremeters I need to pass
In fact usage of
ExecuteReaderAsyncis pretty the same asExecuteReaderand the only difference is that 'read' handler should be async -- something like that:This code should be in async method. If you don't have 'cancellationToken' here you can specify
CancellationToken.None.