A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.data.common.dbcommand.executenonqueryasync below:

DbCommand.ExecuteNonQueryAsync Method (System.Data.Common) | Microsoft Learn

DbCommand.ExecuteNonQueryAsync Method Definition

This method implements the asynchronous version of ExecuteNonQuery(), but returns a Task synchronously, blocking the calling thread.

Overloads ExecuteNonQueryAsync(CancellationToken)

This is the asynchronous version of ExecuteNonQuery(). Providers should override with an appropriate implementation. The cancellation token may optionally be ignored.

The default implementation invokes the synchronous ExecuteNonQuery() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteNonQuery() will be communicated via the returned Task Exception property.

Do not invoke other methods and properties of the DbCommand object until the returned Task is complete.

ExecuteNonQueryAsync()

An asynchronous version of ExecuteNonQuery(), which executes the command against its connection object, returning the number of rows affected.

Invokes ExecuteNonQueryAsync(CancellationToken) with CancellationToken.None.

For more information about asynchronous programming, see Asynchronous Programming.

ExecuteNonQueryAsync(CancellationToken)
Source:
DbCommand.cs
Source:
DbCommand.cs
Source:
DbCommand.cs
Source:
DbCommand.cs

This is the asynchronous version of ExecuteNonQuery(). Providers should override with an appropriate implementation. The cancellation token may optionally be ignored.

The default implementation invokes the synchronous ExecuteNonQuery() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteNonQuery() will be communicated via the returned Task Exception property.

Do not invoke other methods and properties of the DbCommand object until the returned Task is complete.

public:
 virtual System::Threading::Tasks::Task<int> ^ ExecuteNonQueryAsync(System::Threading::CancellationToken cancellationToken);
public virtual System.Threading.Tasks.Task<int> ExecuteNonQueryAsync(System.Threading.CancellationToken cancellationToken);
abstract member ExecuteNonQueryAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
override this.ExecuteNonQueryAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public Overridable Function ExecuteNonQueryAsync (cancellationToken As CancellationToken) As Task(Of Integer)
Parameters Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command.

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

For more information about asynchronous programming, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by ExecuteNonQuery().

See also ExecuteNonQueryAsync()
Source:
DbCommand.cs
Source:
DbCommand.cs
Source:
DbCommand.cs
Source:
DbCommand.cs
public:
 System::Threading::Tasks::Task<int> ^ ExecuteNonQueryAsync();
public System.Threading.Tasks.Task<int> ExecuteNonQueryAsync();
member this.ExecuteNonQueryAsync : unit -> System.Threading.Tasks.Task<int>
Public Function ExecuteNonQueryAsync () As Task(Of Integer)
Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command.

Remarks

For more information about asynchronous programming, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by ExecuteNonQuery().

See also

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4