Once you’ve connected to a data store, you can execute commands against it. In this section, we’ll look at how you can build command objects and execute these against a connection. Specifically, we’ll look at how to invoke commands that return the following:
A single value, such as an aggregate value
A read-only data reader
An updatable, scrollable DataSet
The IDbCommand interface defines the functionality of a command class. Its two implementations, SqlCommand and OleDbCommand, expose the same properties and methods, with the exception that SqlCommand provides support for reading XML. (We’ll discuss this functionality later in this chapter). However, you use all command objects in the same ...