共用方式為


ComErrorCollection 屬性

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

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

語法

'宣告
Public Overridable ReadOnly Property ComErrorCollection As IEnumerable
    Get
'用途
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

屬性值

型別:System.Collections. . :: . .IEnumerable
A IEnumerable collection of ComErrorRecord objects.

實作

ITransSynchronizationAgent. . :: . .ComErrorCollection

備註

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.

[C#]

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