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: ...

Get ADO.NET Programming in Visual Basic™ .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.