Version

CommandBehaviorDefault Property

Specifies the default CommandBehavior used by the method GetReader.
Syntax
'Declaration
 
Protected Property CommandBehaviorDefault As CommandBehavior
protected CommandBehavior CommandBehaviorDefault {get; set;}

Property Value

The CommandBehavior applied when nothing is specified for GetDataReader. By default, after calling GetDataReader the IDataReader implementation returned will behave according to the CommandBehavior of CloseConnection. This is, it will close the underlying connection when finished.
Remarks

Sometimes inheritors may want to perform multiple commands without closing the underlying connection. Setting the CommandBehaviorDefault allows them to modify the default behavior associated with a call to GetDataReader. Note that inheritors always have the option of calling the overload of GetDataReader accepting an explicit CommandBehavior as it's second parameter if the situations calls for a behavior different from that of CommandBehaviorDefault.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also