ZennoLab Assemblies Documentation
ExecuteQuery(String,OrderedDictionary,DbProvider,String,IZennoTable) 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.

Type: ZennoLab.InterfacesLibrary.ProjectModel.IZennoTable

Table for result data.

Execute SQL query and fill table.
Syntax
public static int ExecuteQuery( 
   string query,
   OrderedDictionary param,
   DbProvider provider,
   string connectionString,
   ref IZennoTable table
)

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.

table

Type: ZennoLab.InterfacesLibrary.ProjectModel.IZennoTable

Table for result data.

Return Value

Type: System.Int32

The number of rows affected.

Remarks

Example
The following example shows call the ExecuteQuery method.
var table = project.Tables["Table 1"];
var rowCount = ZennoPoster.Db.ExecuteQuery("SELECT * FROM User", null,
    ZennoLab.InterfacesLibrary.Enums.Db.DbProvider.SqlClient,
    "Data Source=SQLSERVER;Initial Catalog=TestDb;Integrated Security=True;max pool size=500",
    ref table);
$table = $project.Tables["Table 1"];
$rowcount = ZennoLab\CommandCenter\ZennoPoster::Db::ExecuteQuery("SELECT * FROM User", null,
    ZennoLab\InterfacesLibrary\Enums\Db\DbProvider::SqlClient,
    "Data Source=SQLSERVER;Initial Catalog=TestDb;Integrated Security=True;max pool size=500",
    $table);
Requirements

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

See Also

Reference

ZennoPoster.Db Class
ZennoPoster.Db Members
Overload List
ExecuteNonQuery Method
ExecuteScalar Method

Send Feedback