CReplicationRoute.RemoveDestination Method

Removes a destination server that was defined for a Commerce Server Staging (CSS) route.

void RemoveDestination(string destination)

Parameters

  • destination
    The name of the destination server to remove from the route.

Remarks

The CReplicationRoute.RemoveDestination method corresponds to the COM method named ReplicationRoute.RemoveDestination.

Example

The following example removes the destination server TestPC from the route Test.

CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
CReplicationRoute replicationRoute;
int i = 0;
object iterator = i as object;
while (true)
  {
  try
    {
    replicationRoute = replicationServer.EnumRoutes(ref iterator) as CReplicationRoute;
    if (replicationRoute.get_Name().ToString() == "Test")
      {
      replicationRoute.RemoveDestination("TestPC");
      replicationRoute.Commit();
      break;
      }
    }
    catch (System.Runtime.InteropServices.COMException e)
    {
       // Quit if "No more items" or "No routes" error
       if (e.ErrorCode == -2147422485 || e.ErrorCode == -1073680678)
          break;
      else
          throw;
    }
  }

See Also

Other Resources

CReplicationRoute.AddDestination Method

CReplicationRoute.EnumDestination Method

CReplicationRoute Class