Using the SqlConnection as a Starting Point
Once you’ve connected to your SQL Server database, the SqlConnection object can serve as the starting point for a number of operations—creating commands, starting transactions, and retrieving schema.
The SqlCommand class, which We’ll explore in Chapter 4, is the class you use to execute queries against your database. To execute a query, you must set the SqlCommand object’s Connection property to a SqlConnection object. The SqlConnection class provides a CreateCommand method that you can use to simplify the process. This method returns a new SqlCommand object that’s already initialized to use your SqlConnection object.
One benefit to the CreateCommand method is that it’s available on ...