Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 编程 » SQL Anywhere 数据访问 API » SQL Anywhere .NET 2.0 API 参考 » iAnywhere.Data.SQLAnywhere 命名空间 (.NET 2.0) » SACommand 类

 

Parameters 属性

当前语句的参数集合。在 CommandText 中使用问号来表示参数。

语法
Visual Basic

Public Readonly Property Parameters As SAParameterCollection
C#

public SAParameterCollection Parameters { get;}
属性值

SQL 语句或存储过程的参数。缺省值为空集合。

注释

当 CommandType 设置为 Text 时,请使用问号占位符传递参数。例如:

SELECT * FROM Customers WHERE ID = ?

将 SAParameter 对象添加到 SAParameterCollection 的顺序必须与命令文本中该参数问号占位符的位置直接对应。

当集合中的参数与要执行的查询的要求不匹配时,可能会导致错误或抛出异常。

另请参见