Send feedback on this topic.
Teradata.Client.Provider
EndExecuteNonQuery Method



Teradata.Client.Provider Namespace > TdCommand Class : EndExecuteNonQuery Method
IAsyncResult object returned from the corresponding BeginExecuteQuery
Ends the asynchronous execution.
Syntax
'Declaration
 
Public Function EndExecuteNonQuery( _
   ByVal asyncResult As IAsyncResult _
) As Integer
'Usage
 
Dim instance As TdCommand
Dim asyncResult As IAsyncResult
Dim value As Integer
 
value = instance.EndExecuteNonQuery(asyncResult)
public int EndExecuteNonQuery( 
   IAsyncResult asyncResult
)
public:
int EndExecuteNonQuery( 
   IAsyncResult^ asyncResult
) 

Parameters

asyncResult
IAsyncResult object returned from the corresponding BeginExecuteQuery

Return Value

The number of rows that are affected.
Exceptions
ExceptionDescription
Can be thrown because of one of the following: 1) The parameter for asyncResult is null, 2) asyncResult parameter is not associated with execution.
Can be thrown because more in-out/out parameters have been specified than returned from the stored procedure.
Can be thrown because of one of the following: 1) EndExecuteNonQuery was called more than once for the corresponding BeginExecuteNonQuery, 2) EndExecuteNonQuery does not match the call to the corresponding method used for execution. For example, EndExecuteNonQuery was called to end execution of a call to BeginExecuteReader. 3) The command has been disposed.
Can be thrown because of one of the following errors: 1) Teradata returned an error 2) The Data Provider detected an error.
Remarks

An EndExecuteNonQuery must follow a BeginExecuteNonQuery.

If the activity count overflows Int32.MaxValue, Int32.MaxValue value will be returned. The provider will post an event to TdConnection.InfoMessage when an overflow condition occurs. The event will include a warning code and message. The warning message will have the actual activity count. The message code is 111002 and the message text is "An overflow occurred while calculating the activity count, actual value is [ActivityCount]"

NOTE: In order for an application to be aware that an overflow occurred, it must register for the callback with TdConnection.InfoMessage event.

When a stored procedure is executed the TdParameter.Value property is set with the corresponding data retrieved from Teradata.

Exceptions that have been generated by the provider or Teradata during the processing of the request will be thrown when EndExecuteNonQuery is called.

If EndExecuteNonQuery is called before the command has completed processing it will block until the database operation is finished.

Example
For a coding example please see TdCommand.BeginExecuteNonQuery
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