Connected Database Scenario
In the previous section, we described establishing and terminating a connection to the database. This section describes what action we may take while we have an open connection to the database. In other words, we show how to work in the connected database scenario.
When writing database-oriented applications, we run different commands against our data source. We issue our statements with the help of the SqlCommand class. The command class performs the following actions:
Executes SQL statements
Executes DDL (Data Definition Language) statements
Runs stored procedures
We initialize the command object with the command text and connection object. Here is how we create a new command that will query the People ...