Dela via


ComErrorRecord Class

Represents information for an error generated by a replication agent.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Replication.ComErrorRecord

Namespace:  Microsoft.SqlServer.Replication
Assembly:  Microsoft.SqlServer.Replication (in Microsoft.SqlServer.Replication.dll)

Syntax

'Declaration
<GuidAttribute("B01F32EC-954D-4D89-96F4-E3A583F21131")> _
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class ComErrorRecord _
    Implements IComErrorRecord
'Usage
Dim instance As ComErrorRecord
[GuidAttribute("B01F32EC-954D-4D89-96F4-E3A583F21131")]
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
public class ComErrorRecord : IComErrorRecord
[GuidAttribute(L"B01F32EC-954D-4D89-96F4-E3A583F21131")]
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
public ref class ComErrorRecord : IComErrorRecord
[<GuidAttribute("B01F32EC-954D-4D89-96F4-E3A583F21131")>]
[<ComVisibleAttribute(true)>]
[<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)>]
type ComErrorRecord =  
    class 
        interface IComErrorRecord 
    end
public class ComErrorRecord implements IComErrorRecord

The ComErrorRecord type exposes the following members.

Constructors

  Name Description
Public method ComErrorRecord() Creates an instance of the ComErrorRecord class.
Public method ComErrorRecord(String, String, Int32) Creates an instance of the ComErrorRecord class and settings properties of the error.

Top

Properties

  Name Description
Public property Description A description of the error.
Public property ErrorNumber The numeric error code.
Public property SourceType A value that identifies the source of the error.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Examples

This example (C#) shows how to iterate through the returned error collection after an agent run.

foreach (ComErrorRecord errorRecord in agent.ComErrorCollection)
    {
      WriteLog("[ERROR: " + errorRecord.ErrorNumber + 
          errorRecord.Description + "]");
    }

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SqlServer.Replication Namespace