DbCommandBuilder.InitializeCommand(DbCommand) Method

定义

重置 CommandTimeout 上的 TransactionCommandTypeUpdateRowSourceDbCommand 属性。 Resets the CommandTimeout, Transaction, CommandType, and UpdateRowSource properties on the DbCommand.

protected virtual System.Data.Common.DbCommand InitializeCommand (System.Data.Common.DbCommand command);
参数
command
DbCommand

由命令生成器用于对应的 insert、update 或 delete 命令的 DbCommand The DbCommand to be used by the command builder for the corresponding insert, update, or delete command.

返回

用于每个 insert、update 或 delete 操作的 DbCommand 实例。 A DbCommand instance to use for each insert, update, or delete operation. 传入一个 null 值将允许 InitializeCommand(DbCommand) 方法根据与 DbCommand 关联的 Select 命令创建 DbCommandBuilder 对象。 Passing a null value allows the InitializeCommand(DbCommand) method to create a DbCommand object based on the Select command associated with the DbCommandBuilder.

注解

此方法旨在用于构建自定义命令生成器的提供程序编写器。This method is intended for use by provider writers building a custom command builder.

适用于