The command object of ADO.NET 2.0 is packed with the
required methods to make this new feature available. The main operations that
can be performed through command object are:
Listing 2 - Command methods
ExecuteNonQuery()
ExecuteReader()
ExecuteScalar()
ExecuteXmlReader()
Asynchronous model is supported for all the above operations
except ExecuteScalar() method, which is going to return the first row’s first
column value. For programming the above operations asynchronously, command
object has one begin method and one end method for each of their synchronous
counterparts. The begin method will be called to start the execution while end
method will be called when the execution completes. Refer to the Figure 1 for
Asynchronous counterparts of the above operations.
Figure 1 - Available Asynchronous methods