共用方式為


TransSynchronizationAgent.ComErrorCollection Property

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

命名空間: Microsoft.SqlServer.Replication
組件: Microsoft.SqlServer.Replication (in microsoft.sqlserver.replication.dll)

語法

'宣告
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

屬性值

A IEnumerable collection of ComErrorRecord objects.

備註

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

執行緒安全性

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.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

TransSynchronizationAgent Class
TransSynchronizationAgent Members
Microsoft.SqlServer.Replication Namespace