共用方式為


BusinessLogicModule.InsertErrorHandler 方法

Optional method implements the custom business logic invoked when an error occurs at the time an INSERT statement is being uploaded or downloaded.

命名空間:  Microsoft.SqlServer.Replication.BusinessLogicSupport
組件:  Microsoft.SqlServer.Replication.BusinessLogicSupport (在 Microsoft.SqlServer.Replication.BusinessLogicSupport.dll 中)

語法

'宣告
Public Overridable Function InsertErrorHandler ( _
    insertSource As SourceIdentifier, _
    insertedDataSet As DataSet, _
    ByRef errorLogType As ErrorLogType, _
    ByRef customErrorMessage As String, _
    errorCode As Integer, _
    errorMessage As String, _
    ByRef historyLogLevel As Integer, _
    ByRef historyLogMessage As String _
) As ActionOnDataError
'用途
Dim instance As BusinessLogicModule 
Dim insertSource As SourceIdentifier 
Dim insertedDataSet As DataSet 
Dim errorLogType As ErrorLogType 
Dim customErrorMessage As String 
Dim errorCode As Integer 
Dim errorMessage As String 
Dim historyLogLevel As Integer 
Dim historyLogMessage As String 
Dim returnValue As ActionOnDataError 

returnValue = instance.InsertErrorHandler(insertSource, _
    insertedDataSet, errorLogType, customErrorMessage, _
    errorCode, errorMessage, historyLogLevel, _
    historyLogMessage)
public virtual ActionOnDataError InsertErrorHandler(
    SourceIdentifier insertSource,
    DataSet insertedDataSet,
    ref ErrorLogType errorLogType,
    ref string customErrorMessage,
    int errorCode,
    string errorMessage,
    ref int historyLogLevel,
    ref string historyLogMessage
)
public:
virtual ActionOnDataError InsertErrorHandler(
    SourceIdentifier insertSource, 
    DataSet^ insertedDataSet, 
    ErrorLogType% errorLogType, 
    String^% customErrorMessage, 
    int errorCode, 
    String^ errorMessage, 
    int% historyLogLevel, 
    String^% historyLogMessage
)
abstract InsertErrorHandler : 
        insertSource:SourceIdentifier * 
        insertedDataSet:DataSet * 
        errorLogType:ErrorLogType byref * 
        customErrorMessage:string byref * 
        errorCode:int * 
        errorMessage:string * 
        historyLogLevel:int byref * 
        historyLogMessage:string byref -> ActionOnDataError  
override InsertErrorHandler : 
        insertSource:SourceIdentifier * 
        insertedDataSet:DataSet * 
        errorLogType:ErrorLogType byref * 
        customErrorMessage:string byref * 
        errorCode:int * 
        errorMessage:string * 
        historyLogLevel:int byref * 
        historyLogMessage:string byref -> ActionOnDataError
public function InsertErrorHandler(
    insertSource : SourceIdentifier, 
    insertedDataSet : DataSet, 
    errorLogType : ErrorLogType, 
    customErrorMessage : String, 
    errorCode : int, 
    errorMessage : String, 
    historyLogLevel : int, 
    historyLogMessage : String
) : ActionOnDataError

參數

  • insertedDataSet
    型別:System.Data.DataSet
    Dataset that contains the GUID of the row that was inserted.
  • errorCode
    型別:System.Int32
    Error code that corresponds to the underlying replication error that occurred.
  • errorMessage
    型別:System.String
    Error message text that corresponds to the underlying replication error that occurred.
  • historyLogLevel
    型別:System.Int32%
    Log level of the custom message returned by the custom business logic handler.
  • historyLogMessage
    型別:System.String%
    Log message provided by the custom business logic handler. The log message gets written to the distribution database.

傳回值

型別:Microsoft.SqlServer.Replication.BusinessLogicSupport.ActionOnDataError
The ActionOnDataError action that will be taken by the process after the custom business logic handler has executed.

請參閱

參考

BusinessLogicModule 類別

Microsoft.SqlServer.Replication.BusinessLogicSupport 命名空間

其他資源

在合併同步處理期間執行商務邏輯

為合併發行項實作商務邏輯處理常式