The Command Class
This class is used to execute commands against the database. The command can be an SQL statement, a stored procedure, or the name of a table or view. The Command class contains a collection of parameter objects for use in passing values to a stored procedure or SQL statement. The class also contains its own connection object. You can pass in an already created connection object or you can create one directly in the Command class. Either way, the Command class only holds a reference to a connection object so there are no excess connections that will be opened to the server.
There are three different kinds of commands that can be executed by the Command class. These commands are executed by calling one of four execute methods: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access