SqlHelper..::..ExecuteNonQuery Method (SqlTransaction, CommandType, String)

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

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

Syntax


public static int ExecuteNonQuery(
	SqlTransaction transaction,
	CommandType commandType,
	string commandText
)

Parameters

transaction
Type: SqlTransaction
A valid SqlTransaction
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 = ExecuteNonQuery(trans, CommandType.StoredProcedure, "PublishOrders");