SqlHelper..::..ExecuteNonQueryAsync Method (SqlConnection, CommandType, String)

Execute a SqlCommand (that returns no resultset and takes no parameters) against the provided SqlConnection.

Namespace:  Core
Assembly:  Core (in Core.dll)

Syntax


public static Task<int> ExecuteNonQueryAsync(
	SqlConnection connection,
	CommandType commandType,
	string commandText
)

Parameters

connection
Type: SqlConnection
A valid SqlConnection
commandType
Type: CommandType
The CommandType (stored procedure, text, etc.)
commandText
Type: String
The stored procedure name or T-SQL command

Return Value

An int representing the number of rows affected by the command

Remarks


e.g.: int result = ExecuteNonQueryAsync(conn, CommandType.StoredProcedure, "PublishOrders");