Working With Command Objects
A Command object is a specific command that is used to manipulate data in a data source. It is an object representing a DML statement or a stored procedure that is used to retrieve,insert,delet,or modify data in a data source. A data command is an instance of the oledbcommand OR sqlcommand Class. A data command derived from the oledBcommand class can be used to work with any OLE DB provider,whereas a data command derived from the sqlcommand class can be used to access data from a SQL Server.
To retrieve data by using data commands,first a connectoin object is created to connect to the database from where data is to be retrieved. Then,a Command object is created. To access a data sourse,a data command should provide information about the connection for communicating with the data sourse,the DML statement or the name of the stored procedure to execute,and the parameters that may be required for execution of the data command.
The two type of operations performed by a command object to retrieve and modify data in a data sourse are:
- Synchronous operations
- Asynchronous operations
A Command object is a specific command that is used to manipulate data in a data source. It is an object representing a DML statement or a stored procedure that is used to retrieve,insert,delet,or modify data in a data source. A data command is an instance of the oledbcommand OR sqlcommand Class. A data command derived from the oledBcommand class can be used to work with any OLE DB provider,whereas a data command derived from the sqlcommand class can be used to access data from a SQL Server.
To retrieve data by using data commands,first a connectoin object is created to connect to the database from where data is to be retrieved. Then,a Command object is created. To access a data sourse,a data command should provide information about the connection for communicating with the data sourse,the DML statement or the name of the stored procedure to execute,and the parameters that may be required for execution of the data command.
The two type of operations performed by a command object to retrieve and modify data in a data sourse are:
- Synchronous operations
- Asynchronous operations