TransSynchronizationAgent.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
An IEnumerable collection of errors generated by a replication agent.

实现

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

请参阅

参考

TransSynchronizationAgent 类

Microsoft.SqlServer.Replication 命名空间