MergeArticle.ArticleResolver Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Получает или устанавливает дружественное имя пользовательского разрешающего конфликтов или обработчика бизнес-логики, используемого при синхронизации статьи.
public:
property System::String ^ ArticleResolver { System::String ^ get(); void set(System::String ^ value); };
public string ArticleResolver { get; set; }
member this.ArticleResolver : string with get, set
Public Property ArticleResolver As String
Значение свойства
Некоторое значение String.
Примеры
// Define the Publisher, publication, and article names.
string publisherName = publisherInstance;
string publicationName = "AdvWorksSalesOrdersMerge";
string publicationDbName = "AdventureWorks2012";
string articleName = "SalesOrderHeader";
// Set the friendly name of the business logic handler.
string customLogic = "OrderEntryLogic";
MergeArticle article = new MergeArticle();
// Create a connection to the Publisher.
ServerConnection conn = new ServerConnection(publisherName);
try
{
// Connect to the Publisher.
conn.Connect();
// Set the required properties for the article.
article.ConnectionContext = conn;
article.Name = articleName;
article.DatabaseName = publicationDbName;
article.PublicationName = publicationName;
// Load the article properties.
if (article.LoadProperties())
{
article.ArticleResolver = customLogic;
}
else
{
// Throw an exception of the article does not exist.
throw new ApplicationException(String.Format(
"{0} is not published in {1}", articleName, publicationName));
}
}
catch (Exception ex)
{
// Do error handling here and rollback the transaction.
throw new ApplicationException(String.Format(
"The business logic handler {0} could not be associated with " +
" the {1} article.",customLogic,articleName), ex);
}
finally
{
conn.Disconnect();
}
' Define the Publisher, publication, and article names.
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2012"
Dim articleName As String = "SalesOrderHeader"
' Set the friendly name of the business logic handler.
Dim customLogic As String = "OrderEntryLogic"
Dim article As MergeArticle = New MergeArticle()
' Create a connection to the Publisher.
Dim conn As ServerConnection = New ServerConnection(publisherName)
Try
' Connect to the Publisher.
conn.Connect()
' Set the required properties for the article.
article.ConnectionContext = conn
article.Name = articleName
article.DatabaseName = publicationDbName
article.PublicationName = publicationName
' Load the article properties.
If article.LoadProperties() Then
article.ArticleResolver = customLogic
Else
' Throw an exception of the article does not exist.
Throw New ApplicationException(String.Format( _
"{0} is not published in {1}", articleName, publicationName))
End If
Catch ex As Exception
' Do error handling here and rollback the transaction.
Throw New ApplicationException(String.Format( _
"The business logic handler {0} could not be associated with " + _
" the {1} article.", customLogic, articleName), ex)
Finally
conn.Disconnect()
End Try
Комментарии
Свойство ArticleResolver может быть получено членами роли системного администратора фиксированного сервера в Publisher и у Subscriber (для повторной публикации подписчиков). Её также могут получить члены роли db_owner фиксированной базы данных в базе данных публикаций, участники роли replmonitor фиксированной базы данных в Дистрибьюторе и пользователи, входящие в список доступа к публикациям (PAL).
Это ArticleResolver свойство может быть зададено членами роли сервера с фиксированным системным администратором в Publisher. Он также может устанавливаться членами db_owner фиксированной роли базы данных в базе данных публикаций.
Извлечение ArticleResolver эквивалентно выполнению sp_helpmergearticle (Transact-SQL).
Настройка ArticleResolver эквивалентна исполнению sp_addmergearticle (Transact-SQL) или sp_changemergearticle (Transact-SQL).