Ado. NET 3-command Object---Shinepans

Source: Internet
Author: User

Command object can be divided into 4 kinds, Sqlcommand,oledbcomman,olbccommand,oraclecomman


Property
Description
CommandType Gets or sets the type of command object to execute
CommandText Gets or sets the SQL statement or stored procedure name or table name to be executed against the data source
CommandTimeout Gets or sets the wait time before terminating an attempt to execute a command and generating an error
Connection Gets or sets the name of the connection object used by the Command object
Parameters Gets the parameter collection that the command object needs to use

CommandType enumeration members

Member name Description
Text SQL Text Command
StoredProcedure Name of the stored procedure
TableDirect Name of the table

Common methods of SqlCommand

Method Description
ExecuteNonQuery Used to execute non-select commands, such as Insert,delete,update, to return the number of rows affected, or to create new, update, and delete database objects
ExecuteScalar Used to execute a SELECT query command that returns the value of the first column in the first row of data, which is typically used to execute a SELECT command that uses the count or Sum function
ExecuteReader Executes the SELECT command and returns a DataReader object that is a read-only forward data set

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.