Execute an IDbCommand (that returns no resultset and takes no parameters) against the provided IDbConnection.

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,
	CommandType commandType,
	string commandText
)
Visual Basic
Public Overridable Function ExecuteNonQuery ( 
	connection As IDbConnection,
	commandType As CommandType,
	commandText As String
) As Integer

Parameters

connection
Type: System.Data..::..IDbConnection
A valid IDbConnection
commandType
Type: System.Data..::..CommandType
The CommandType (stored procedure, text, etc.)
commandText
Type: System..::..String
The stored procedure name or SQL command

Return Value

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

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThrown if commandText is null
System..::..ArgumentNullExceptionThrown if connection is null

See Also