Send feedback on this topic.
Teradata.Client.Provider
BeginExecuteReader(CommandBehavior) Method



Teradata.Client.Provider Namespace > TdCommand Class > BeginExecuteReader Method : BeginExecuteReader(CommandBehavior) Method
One of the Data.CommandBehavior enumerations values.
Initiates the asynchronous request that will use the specific CommandBehavior and retrieves one or more result sets from Teradata.
Syntax
'Declaration
 
Public Overloads Function BeginExecuteReader( _
   ByVal behavior As CommandBehavior _
) As IAsyncResult
'Usage
 
Dim instance As TdCommand
Dim behavior As CommandBehavior
Dim value As IAsyncResult
 
value = instance.BeginExecuteReader(behavior)
public IAsyncResult BeginExecuteReader( 
   CommandBehavior behavior
)
public:
IAsyncResult^ BeginExecuteReader( 
   CommandBehavior behavior
) 

Parameters

behavior
One of the Data.CommandBehavior enumerations values.

Return Value

Returns a IAsyncResult object.
Exceptions
ExceptionDescription
Indicates that the requested CommandBehavior is not supported.
Indicates the TdParameter.Offset is outside of 0 through array size � 1.
Indicates one or more parameters cannot be converted to Teradata native types.
The behavior is not one of the System.Data.CommandBehavior enumeration members.
Can be thrown because of one of the following errors: 1) TdConnection is not in Open state or is null. 2) The local transaction associated with TdCommand is not the same local transaction associated with the TdConnection --assign local transaction to TdCommand.Transaction property.
The TdCommand is closed / disposed.
Can be thrown because the Data Provider detected an error.
Remarks

The call to BeginExecuteReader returns after the request has been successfully sent to Teradata. Any exceptions that are generated by the provider while initializing the request will be thrown during the call to BeginExecuteReader. Exceptions that are generated by the provider or Teradata during the processing of the request will be thrown when TdCommand.EndExecuteReader is called.

The DDL statement CREATE PROCEDURE cannot be specified in an asynchronous execution. If it has been specified a TdException will be thrown when TdCommand.EndExecuteReader is called.

A connection can only have one active request. Therefore, if an asynchronous request is being processed by the provider an exception will be thrown when an attempt is made to start another asynchronous request.

The TdCommand.CommandTimeout property is not applicable to asynchronous execution and will be ignored when a command is asynchronously executed.

If behavior is Data.CommandBehavior.SchemaOnly, BeginExecuteReader will execute the command synchronously.

Example
See TdCommand.BeginExecuteReader for a code example.
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdCommand Class
TdCommand Members
Overload List