ZennoLab Assemblies Documentation
ExecuteNonQuery Method
Example 

Type: System.String

SQL query.

Type: System.Collections.Specialized

Query parameters.

Type: ZennoLab.InterfacesLibrary.Enums.Db.DbProvider

Data provider type.

Type: System.String

Connection string.

Executes a SQL statement against the connection and returns the number of rows affected.
Syntax
public static int ExecuteNonQuery( 
   string query,
   OrderedDictionary param,
   DbProvider provider,
   string connectionString
)

Parameters

query

Type: System.String

SQL query.

param

Type: System.Collections.Specialized

Query parameters.

provider

Type: ZennoLab.InterfacesLibrary.Enums.Db.DbProvider

Data provider type.

connectionString

Type: System.String

Connection string.

Return Value

Type: System.Int32

The number of rows affected.

Remarks

Example
The following example shows call the ExecuteNonQuery method.
var rowCount = ZennoPoster.Db.ExecuteNonQuery("DELETE FROM User WHERE Id = 2", null,
    ZennoLab.InterfacesLibrary.Enums.Db.DbProvider.SqlClient,
    "Data Source=SQLSERVER;Initial Catalog=TestDb;Integrated Security=True;max pool size=500");
$rowCount = ZennoLab\CommandCenter\ZennoPoster::Db::ExecuteNonQuery("DELETE FROM User WHERE Id = 2", null,
    ZennoLab\InterfacesLibrary\Enums\Db\DbProvider::SqlClient,
    "Data Source=SQLSERVER;Initial Catalog=TestDb;Integrated Security=True;max pool size=500");
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

ZennoPoster.Db Class
ZennoPoster.Db Members
ExecuteQuery Method
ExecuteScalar Method

Send Feedback