I'm doing some more working with AJAX, and JSON calls, and I've noticed the the SqlCommand Object has a two methods, ExecuteNonQuery(), and ExecuteNonQueryAsync(), what exactly are the differences in these methods?
Asked
Active
Viewed 6,301 times
0
-
1First one is blocking call, 2nd one is asynchronous – AD.Net Mar 09 '14 at 20:59
1 Answers
2
If you call ExecuteNonQuery
your code will wait until it completes.
If you call ExecuteNonQueryAsync
your code will continue execution and you can track when the actual call to ExecuteNonQueryAsync
completes via Task<int>
object that it returns.

Oleksandr Kobylianskyi
- 3,281
- 20
- 33