Skip to content

Repository files navigation

Build status

AsyncDataAdapter

Implementation of asynchronous methods on SqlDataAdapter (support for async/await).

The implementation is based on source code provided by Microsoft on GitHub.

Info

  • Branch DotNetSource contains original Microsoft .NET sources to simplify resynchronization. Comments contains original sources.
  • Only read operations are now supported. Feel free to contribute with the rest.

Nuget package

https://www.nuget.org/packages/AsyncDataAdapter/

Sample usage for DataTable

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);}}}

Sample usage for DataSet

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);}}}

About

Async/await implementation of SqlDataAdapter

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages