OracleCommandBuilder.GetDeleteCommand 方法
定义
获取自动生成的、对数据库执行删除操作所需的 OracleCommand 对象。Gets the automatically generated OracleCommand object required to perform deletions on the database.
重载
| GetDeleteCommand() |
获取自动生成的、对数据库执行删除操作所需的 OracleCommand 对象。Gets the automatically generated OracleCommand object required to perform deletions on the database. |
| GetDeleteCommand(Boolean) |
获取自动生成的、对数据库执行删除操作所需的 OracleCommand 对象。Gets the automatically generated OracleCommand object required to perform deletions on the database. |
注解
您可以使用 GetDeleteCommand 方法来进行信息性或故障排除,因为它返回 OracleCommand 要执行的对象。You can use the GetDeleteCommand method for informational or troubleshooting purposes because it returns the OracleCommand object to be executed.
您还可以将 GetDeleteCommand 用作修改后的命令的基础。You can also use GetDeleteCommand as the basis of a modified command. 例如,你可以调用 GetDeleteCommand 并修改 CommandText 值,然后在上显式设置该值 OracleDataAdapter 。For example, you might call GetDeleteCommand and modify the CommandText value, and then explicitly set that on the OracleDataAdapter.
当应用程序调用或时,将首先生成 SQL Update 语句 GetDeleteCommand 。The SQL statements are first generated when the application calls either Update or GetDeleteCommand.
有关详细信息,请参阅使用 CommandBuilders 生成命令。For more information, see Generating Commands with CommandBuilders.
GetDeleteCommand()
获取自动生成的、对数据库执行删除操作所需的 OracleCommand 对象。Gets the automatically generated OracleCommand object required to perform deletions on the database.
public:
System::Data::OracleClient::OracleCommand ^ GetDeleteCommand();
public System.Data.OracleClient.OracleCommand GetDeleteCommand ();
member this.GetDeleteCommand : unit -> System.Data.OracleClient.OracleCommand
override this.GetDeleteCommand : unit -> System.Data.OracleClient.OracleCommand
Public Function GetDeleteCommand () As OracleCommand
返回
自动生成的、执行删除操作所需的 OracleCommand 对象。The automatically generated OracleCommand object required to perform deletions.
注解
您可以使用 GetDeleteCommand 方法来进行信息性或故障排除,因为它返回 OracleCommand 要执行的对象。You can use the GetDeleteCommand method for informational or troubleshooting purposes because it returns the OracleCommand object to be executed.
您还可以将 GetDeleteCommand 用作修改后的命令的基础。You can also use GetDeleteCommand as the basis of a modified command. 例如,你可以调用 GetDeleteCommand 并修改 CommandText 值,然后在上显式设置该值 OracleDataAdapter 。For example, you might call GetDeleteCommand and modify the CommandText value, and then explicitly set that on the OracleDataAdapter.
当应用程序调用或时,将首先生成 SQL Update 语句 GetDeleteCommand 。The SQL statements are first generated when the application calls either Update or GetDeleteCommand.
有关详细信息,请参阅使用 CommandBuilders 生成命令。For more information, see Generating Commands with CommandBuilders.
适用于
GetDeleteCommand(Boolean)
获取自动生成的、对数据库执行删除操作所需的 OracleCommand 对象。Gets the automatically generated OracleCommand object required to perform deletions on the database.
public:
System::Data::OracleClient::OracleCommand ^ GetDeleteCommand(bool useColumnsForParameterNames);
public System.Data.OracleClient.OracleCommand GetDeleteCommand (bool useColumnsForParameterNames);
override this.GetDeleteCommand : bool -> System.Data.OracleClient.OracleCommand
Public Function GetDeleteCommand (useColumnsForParameterNames As Boolean) As OracleCommand
参数
- useColumnsForParameterNames
- Boolean
如果为 true,则生成与列名匹配的参数名(如果可能)。true to generate parameter names matching column names, if possible. false 生成 @p1 、等 @p2 。false to generate @p1, @p2, and so on.
返回
自动生成的、执行删除操作所需的 OracleCommand 对象。The automatically generated OracleCommand object required to perform deletions.
注解
您可以使用 GetDeleteCommand 方法来进行信息性或故障排除,因为它返回 OracleCommand 要执行的对象。You can use the GetDeleteCommand method for informational or troubleshooting purposes because it returns the OracleCommand object to be executed.
您还可以将 GetDeleteCommand 用作修改后的命令的基础。You can also use GetDeleteCommand as the basis of a modified command. 例如,你可以调用 GetDeleteCommand 并修改 CommandText 值,然后在上显式设置该值 OracleDataAdapter 。For example, you might call GetDeleteCommand and modify the CommandText value, and then explicitly set that on the OracleDataAdapter.
当应用程序调用或时,将首先生成 SQL Update 语句 GetDeleteCommand 。The SQL statements are first generated when the application calls either Update or GetDeleteCommand.
生成参数名称时,默认行为是对 @p1 各种参数使用、 @p2 等。The default behavior, when generating parameter names, is to use @p1, @p2, and so on, for the various parameters. 通过 true 为参数传递,可以 useColumnsForParameterNames 强制根据 OracleCommandBuilder 列名生成参数。Passing true for the useColumnsForParameterNames parameter allows you to force the OracleCommandBuilder to generate parameters based on the column names instead. 仅当满足以下条件时,此操作才会成功:This succeeds only if the following conditions are met:
ParameterNameMaxLength已指定,其长度等于或大于生成的参数名称。The ParameterNameMaxLength has been specified and its length is equal to or greater than the generated parameter name.
生成的参数名称满足正则表达式中指定的条件 ParameterNamePattern 。The generated parameter name meets the criteria specified in the ParameterNamePattern regular expression.
ParameterMarkerFormat指定了。A ParameterMarkerFormat is specified.
有关详细信息,请参阅使用 CommandBuilders 生成命令。For more information, see Generating Commands with CommandBuilders.