OracleCommandBuilder.DeriveParameters(OracleCommand) 方法

定义

从在 OracleCommand 中指定的存储过程中检索参数信息并填充指定的 Parameters 对象的 OracleCommand 集合。Retrieves parameter information from the stored procedure specified in the OracleCommand and populates the Parameters collection of the specified OracleCommand object.

public:
 static void DeriveParameters(System::Data::OracleClient::OracleCommand ^ command);
public static void DeriveParameters (System.Data.OracleClient.OracleCommand command);
static member DeriveParameters : System.Data.OracleClient.OracleCommand -> unit
Public Shared Sub DeriveParameters (command As OracleCommand)

参数

command
OracleCommand

引用将从其中导出参数信息的存储过程的 OracleCommandThe OracleCommand referencing the stored procedure from which the parameter information is to be derived. 将派生参数添加到 ParametersOracleCommand 集合中。The derived parameters are added to the Parameters collection of the OracleCommand.

例外

命令文本是无效的存储过程名称,或指定的 CommandType 不是 StoredProcedureThe command text is not a valid stored procedure name, or the CommandType specified was not StoredProcedure.

注解

DeriveParameters 覆盖的任何现有参数信息 OracleCommandDeriveParameters overwrites any existing parameter information for the OracleCommand.

DeriveParameters 需要对数据库进行额外的调用以获取信息。DeriveParameters requires an extra call to the database to obtain the information. 如果事先知道了参数信息,则通过显式设置信息更有效地填充参数集合。If the parameter information is known in advance, it is more efficient to populate the parameters collection by setting the information explicitly.

只能 DeriveParameters 与存储过程一起使用。You can only use DeriveParameters with stored procedures. 不能使用 DeriveParameters 来填充 OracleParameterCollection 任意 transact-sql 语句,如参数化 SELECT 语句。You cannot use DeriveParameters to populate the OracleParameterCollection with arbitrary Transact-SQL statements, such as a parameterized SELECT statement.

有关详细信息,请参阅 配置参数和参数数据类型For more information, see Configuring Parameters and Parameter Data Types.

适用于