SqlHelper..::..ExecuteNonQuery Method (String, String, array<Object>[]()[][])

Execute a stored procedure via a SqlCommand (that returns no resultset) against the database specified in the connection string using the provided parameter values. This method will query the database to discover the parameters for the stored procedure (the first time each stored procedure is called), and assign the values based on parameter order.

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

Syntax


public static int ExecuteNonQuery(
	string connectionString,
	string spName,
	params Object[] parameterValues
)

Parameters

connectionString
Type: String
A valid connection string for a SqlConnection
spName
Type: String
The name of the stored prcedure
parameterValues
Type: array<Object>[]()[][]
An array of objects to be assigned as the input values of the stored procedure

Return Value

An int representing the number of rows affected by the command

Exceptions


ExceptionCondition
ArgumentNullException connectionString or spName

Remarks


This method provides no access to output parameters or the stored procedure's return value parameter. e.g.: int result = ExecuteNonQuery(connString, "PublishOrders", 24, 36);