ComErrorCollection Property

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)

public virtual IEnumerable ComErrorCollection { get; }

Property Value

Type: System.Collections.IEnumerable

An IEnumerable collection of errors generated by a replication agent.

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

The following example 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 + "]");
Return to top
© 2015 Microsoft