SqlRowsCopiedEventArgs.Abort 属性

定义

获取或设置指示是否应中止批量复制操作的值。Gets or sets a value that indicates whether the bulk copy operation should be aborted.

public:
 property bool Abort { bool get(); void set(bool value); };
public bool Abort { get; set; }
member this.Abort : bool with get, set
Public Property Abort As Boolean

属性值

Boolean

如果应中止批量复制操作,则为 true;否则为 falsetrue if the bulk copy operation should be aborted; otherwise false.

注解

使用 Abort 属性可取消大容量复制操作。Use the Abort property to cancel a bulk copy operation. 设置 Aborttrue 以中止大容量复制操作。Set Abort to true to abort the bulk copy operation.

如果从调用 Close 方法,则 SqlRowsCopied 会生成异常,且 SqlBulkCopy 对象状态不会更改。If you call the Close method from SqlRowsCopied, an exception is generated, and the SqlBulkCopy object state does not change.

如果应用程序专门 SqlTransaction 在构造函数中创建对象 SqlCommand ,则不会回滚事务。If an application specifically creates a SqlTransaction object in the SqlCommand constructor, the transaction is not rolled back. 应用程序负责确定是否需要回滚操作,如果是,则必须调用 SqlTransaction.Rollback 方法。The application is responsible for determining whether it is required to rollback the operation, and if so, it must call the SqlTransaction.Rollback method. 如果应用程序没有创建事务,则会自动回滚与当前批处理对应的内部事务。If the application does not create a transaction, the internal transaction corresponding to the current batch is automatically rolled back. 但会保留与大容量复制操作中以前的批相关的更改,因为这些更改已提交。However, changes related to previous batches within the bulk copy operation are retained, because the transactions for them already have been committed.

适用于