Implementation of asynchronous methods on SqlDataAdapter (support for async/await).
The implementation is based on source code provided by Microsoft on GitHub.
- Branch
DotNetSourcecontains original Microsoft .NET sources to simplify resynchronization. Comments contains original sources. - Only read operations are now supported. Feel free to contribute with the rest.
https://www.nuget.org/packages/AsyncDataAdapter/
using(varconn=newSqlConnection()){conn.ConnectionString=ConnectionString;awaitconn.OpenAsync();using(varc=conn.CreateCommand()){c.CommandText="GetFast";c.CommandType=CommandType.StoredProcedure;c.Parameters.Add("@Number",SqlDbType.Int).Value=100000;using(vara=newSqlDataAdapter(c)){vardt=newDataTable();varr=awaita.FillAsync(dt);}}}using(varconn=newSqlConnection()){conn.ConnectionString=ConnectionString;awaitconn.OpenAsync();using(varc=conn.CreateCommand()){c.CommandText="GetFast";c.CommandType=CommandType.StoredProcedure;c.Parameters.Add("@Number",SqlDbType.Int).Value=100000;using(vara=newSqlDataAdapter(c)){vards=newDataSet();varr=awaita.FillAsync(ds);}}}