ReplicationServer.EnumBusinessLogicHandlers Method
SQL Server 2005
Returns the business logic handlers registered at the server.
Namespace: Microsoft.SqlServer.Replication
Assembly: Microsoft.SqlServer.Rmo (in microsoft.sqlserver.rmo.dll)
Assembly: Microsoft.SqlServer.Rmo (in microsoft.sqlserver.rmo.dll)
The EnumBusinessLogicHandlers method can only be called by members of the sysadmin fixed server role and members of the db_owner fixed database role.
Calling EnumBusinessLogicHandlers is equivalent to executing sp_enumcustomresolvers (Transact-SQL).
This namespace, class, or member is supported only in version 2.0 of the .NET Framework.
// Specify the Distributor name and business logic properties. string distributorName = publisherInstance; string assemblyName = @"C:\Program Files\Microsoft SQL Server\90\COM\CustomLogic.dll"; string className = "Microsoft.Samples.SqlServer.BusinessLogicHandler.OrderEntryBusinessLogicHandler"; string friendlyName = "OrderEntryLogic"; ReplicationServer distributor; BusinessLogicHandler customLogic; // Create a connection to the Distributor. ServerConnection distributorConn = new ServerConnection(distributorName); try { // Connect to the Distributor. distributorConn.Connect(); // Set the Distributor properties. distributor = new ReplicationServer(distributorConn); // Set the business logic handler properties. customLogic = new BusinessLogicHandler(); customLogic.DotNetAssemblyName = assemblyName; customLogic.DotNetClassName = className; customLogic.FriendlyName = friendlyName; customLogic.IsDotNetAssembly = true; Boolean isRegistered = false; // Check if the business logic handler is already registered at the Distributor. foreach (BusinessLogicHandler registeredLogic in distributor.EnumBusinessLogicHandlers()) { if (registeredLogic == customLogic) { isRegistered = true; } } // Register the custom logic. if (!isRegistered) { distributor.RegisterBusinessLogicHandler(customLogic); } } catch (Exception ex) { // Do error handling here. throw new ApplicationException(string.Format( "The {0} assembly could not be registered.", assemblyName), ex); } finally { distributorConn.Disconnect(); }
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.
