asp.net.ph

CommandBehavior Enumeration

System.Data Namespace


Specifies a description of the results and the affect on the database of the query command.

Remarks

The CommandBehavior values are used by the ExecuteReader method of IDbCommand and any classes derived from it.

This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.

Members


Member Name Description
CloseConnection When the command is executed, the associated Connection object is closed when the associated DataReader object is closed.
KeyInfo The query returns column and primary key information. the query is executed without any locking on the selected rows. When using KeyInfo, the SQL Server™ .NET Data Provider appends a FOR BROWSE clause to the statement being executed. The user should be aware of potential side effects, such as interference with the use of SET FMTONLY ON statements. See SQL Server™ Books Online for more information.
SchemaOnly The query returns column information only and does not affect the database state.
SequentialAccess The results of the query are read sequentially to the column level. This allows an application to read large binary values using the GetChars or GetBytes methods of a .NET data provider. Execution of the query may affect the database state.
SingleResult The query returns a single result. Execution of the query may affect the database state.
SingleRow The query is expected to return a single row. Execution of the query may affect the database state. Some .NET data providers may, but are not required to, use this information to optimize the performance of the command. When you specify SingleRow with the ExecuteReader method of the OleDbCommand object, the OLE DB .NET Data Provider performs binding using the OLE DB IRow interface if it is available. Otherwise, it uses the IRowset interface. If your SQL statement is expected to return only a single row, specifying SingleRow can also improve application performance.

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph