Database.Execute Method (SqlBuilder, Int32, Boolean)

Executes the nonQuery command. Optionally uses a transaction and validates affected records value before committing.

Namespace:  DbExtensions
Assembly: DbExtensions.dll

Syntax

public int Execute(
	SqlBuilder nonQuery,
	int affect = -1,
	bool exact = false
)

Parameters

nonQuery

Type: DbExtensions.SqlBuilder
The non-query command to execute.

affect (Optional)

Type: System.Int32
The number of records the command should affect. This value is ignored if less or equal to -1.

exact (Optional)

Type: System.Boolean
true if the number of affected records should exactly match affect; false if a lower number is acceptable.

Return Value

Type: Int32
The number of affected records.

Exceptions

Exception Condition
ChangeConflictException The number of affected records is not equal to affect.

See Also

Reference

Database Class
DbExtensions Namespace

© Max Toro Q.