Execute a stored procedure via an IDbCommand (that returns no resultset) against the specified IDbConnection 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: CodeSmith.Engine
Assembly: CodeSmith.Engine (in CodeSmith.Engine.dll) Version: 6.0.0.0 (7.0.0.15127)

Syntax

C#
public virtual int ExecuteNonQuery(
	IDbConnection connection,
	string spName,
	params Object[] parameterValues
)
Visual Basic
Public Overridable Function ExecuteNonQuery ( 
	connection As IDbConnection,
	spName As String,
	ParamArray parameterValues As Object()
) As Integer

Parameters

connection
Type: System.Data..::..IDbConnection
A valid IDbConnection
spName
Type: System..::..String
The name of the stored procedure
parameterValues
Type: array<System..::..Object>[]()[][]
An array of objects to be assigned as the input values of the stored procedure

Return Value

Type: Int32
An int representing the number of rows affected by the command

Remarks

This method provides no access to output parameters or the stored procedure's return value parameter.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThrown if spName is null
System..::..ArgumentExceptionThrown if the parameter count does not match the number of values supplied
System..::..ArgumentNullExceptionThrown if connection is null

See Also