Udostępnij za pośrednictwem


TransSynchronizationAgent.ComErrorCollection Property

Gets a collection of errors that are generated by the replication agent.

Namespace: Microsoft.SqlServer.Replication
Assembly: Microsoft.SqlServer.Replication (in microsoft.sqlserver.replication.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property ComErrorCollection As IEnumerable
public virtual IEnumerable ComErrorCollection { get; }
public:
virtual property IEnumerable^ ComErrorCollection {
    IEnumerable^ get ();
}
/** @property */
public IEnumerable get_ComErrorCollection ()
public function get ComErrorCollection () : IEnumerable

Property Value

A IEnumerable collection of ComErrorRecord objects.

Remarks

To view all agent errors, you must iterate through the collection of ComErrorRecord objects.

Example

The following example shows how to iterate through the returned error collection after an agent run.

[C#]

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

Thread Safety

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

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

TransSynchronizationAgent Class
TransSynchronizationAgent Members
Microsoft.SqlServer.Replication Namespace