Click or drag to resize

IDatabaseExecuteNonQuery Method

Execute a SQL query such as INSERT, UPDATE and DELETE and returns the number of rows affected.

Namespace:  AskiaFieldCom.SqlDatabase
Assembly:  AskiaFieldCom (in AskiaFieldCom.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
int ExecuteNonQuery(
	string sql,
	IDictionary<string, Object> parameters
)

Parameters

sql
Type: SystemString
SQL query to execute.
parameters
Type: System.Collections.GenericIDictionaryString, Object
List of SQL parameters to apply on the query.

Return Value

Type: Int32
Returns the number of rows affected by the query.
Remarks
Examples

Delete some records.

var deletedCount = db.ExecuteNonQuery("DELETE FROM [MyTable] WHERE [Id] IN (@ids)", new Dictionary<string, object> {
    {"@ids", new List<int> {1, 2, 3}}
});
See Also