SqlCommandExtensions.ExecuteReaderWithRetry Method (SqlCommand, CommandBehavior)
Retired Content |
---|
This content and the technology described is outdated and is no longer being maintained. For more information about Transient Fault Handling, see Transient Fault Handling. |
Sends the specified command to the connection and builds a SqlDataReader object using one of the CommandBehavior values. Uses the default retry policy when executing the command.
Namespace: Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure
Assembly: Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling (in Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.dll) Version: 5.0.1118.0 (5.0.1118.0)
Syntax
public static SqlDataReader ExecuteReaderWithRetry(
this SqlCommand command,
CommandBehavior behavior
)
'Declaration
<ExtensionAttribute> _
Public Shared Function ExecuteReaderWithRetry ( _
command As SqlCommand, _
behavior As CommandBehavior _
) As SqlDataReader
[ExtensionAttribute]
public:
static SqlDataReader^ ExecuteReaderWithRetry(
SqlCommand^ command,
CommandBehavior behavior
)
Parameters
- command
Type: System.Data.SqlClient.SqlCommand
The command object that is required as per extension method declaration.
- behavior
Type: System.Data.CommandBehavior
One of the System.Data.CommandBehavior values.
Return Value
A System.Data.SqlClient.SqlDataReader object.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type SqlCommand. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .
See Also
ExecuteReaderWithRetry Overload
Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure Namespace