Now that you've seen how to connect to the database, it's time to start issuing commands. The easiest way to send commands to the database is with the SqlCommand object.
The SqlCommand object contains all the functionality that you will need to issue Select, Insert, Update, and Delete statements. The SqlCommand object can return a DataReader, giving you the ability to iterate through the result set return from a Select. Finally, a SqlCommand allows you to call stored procedures, specifying the input and output arguments, and providing access to the return value.
Listing 4.2 shows the SqlCommand object in action.
// // Connect ...