All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
The page you are viewing does not exist in the .NET Core 3.0+ platform documentation. This link will take you to the parent topic of the current section.

Session.ExecuteNonQuery(String, String[], QueryParameterCollection) Method

Executes the specified SQL statement and returns the number of rows affected.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v20.1.dll

Declaration

public int ExecuteNonQuery(
    string sql,
    string[] parameterNames,
    QueryParameterCollection parameters
)
Public Function ExecuteNonQuery(
    sql As String,
    parameterNames As String(),
    parameters As QueryParameterCollection
) As Integer

Parameters

Name Type Description
sql String

Specifies an SQL statement.

parameterNames String[]

Specifies parameter names.

parameters QueryParameterCollection

Specifies query parameter values.

Returns

Type Description
Int32

The number of rows affected by the executed SQL statement.

Remarks

Use the ExecuteNonQuery method to execute SQL statements that do not produce result sets, such as UPDATE, INSERT, and DELETE statements.

Use QueryParameterCollection to pass strongly-typed parameters. See examples here: Always Encrypted (SQL Server only).

To learn more about executing SQL statements in XPO, refer to Direct SQL Queries.

NOTE

The ExecuteNonQuery method sends statements directly, so the correct statement syntax and parameter names format depends on a particular database server.

See Also