Condividi tramite


Proprietà TransSynchronizationAgent.ComErrorCollection

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

Spazio dei nomi  Microsoft.SqlServer.Replication
Assembly:  Microsoft.SqlServer.Replication (in Microsoft.SqlServer.Replication.dll)

Sintassi

'Dichiarazione
Public Overridable ReadOnly Property ComErrorCollection As IEnumerable 
    Get
'Utilizzo
Dim instance As TransSynchronizationAgent 
Dim value As IEnumerable 

value = instance.ComErrorCollection
public virtual IEnumerable ComErrorCollection { get; }
public:
virtual property IEnumerable^ ComErrorCollection {
    IEnumerable^ get ();
}
abstract ComErrorCollection : IEnumerable 
override ComErrorCollection : IEnumerable
function get ComErrorCollection () : IEnumerable

Valore proprietà

Tipo: System.Collections.IEnumerable
An IEnumerable collection of errors generated by a replication agent.

Implementa

ITransSynchronizationAgent.ComErrorCollection

Osservazioni

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

Esempi

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 + "]");
    }

Vedere anche

Riferimento

TransSynchronizationAgent Classe

Spazio dei nomi Microsoft.SqlServer.Replication