Parameters Property

A collection of parameters for the current statement. Use the @name parameter or question marks in the CommandText to indicate parameters.

Syntax

AseParameterCollection Parameters

Access

Read-only

Property Value

The parameters of the SQL statement or stored procedure. The default value is an empty collection.

Usage

  • When CommandType is set to Text, use the @name parameter. For example:

    SELECT * FROM Customers WHERE CustomerID = @name

    Or, if NamedParameters is set to “false” use ? parameter markers. For example:

    SELECT * FROM Customers WHERE CustomerID = ?
  • If you use the question mark placeholder, the order in which AseParameter objects are added to the AseParameterCollection must directly correspond to the position of the question mark placeholder for the parameter in the command text.

  • When the parameters in the collection do not match the requirements of the query to be executed, an error can result or an exception can be thrown.

  • You have to specify the AseDbType for output parameters (whether prepared or not).

Related concepts
AseParameterCollection Class