Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

RMO Generate snapshots

From Wiki

Jump to: navigation, search

Use this base method to generate a snapshot for a publication.

  1. public void InitSnapshot()
  2.         {
  3.             string publicationName = <publication name>;
  4.             string publicationDbName = <publication database>;
  5.             string publisherName = <publication instance>;
  6.             string distributorName = <distrinutor instance>;
  7.  
  8.             SnapshotGenerationAgent agent;
  9.  
  10.             try
  11.             {
  12.                 agent = new SnapshotGenerationAgent();
  13.                 agent.Distributor = distributorName;
  14.                 agent.DistributorSecurityMode = SecurityMode.Integrated;
  15.                 agent.Publisher = publisherName;
  16.                 agent.PublisherSecurityMode = SecurityMode.Integrated;
  17.                 agent.Publication = publicationName;
  18.                 agent.PublisherDatabase = publicationDbName;
  19.                 agent.ReplicationType = ReplicationType.Merge;
  20.  
  21.                 agent.GenerateSnapshot();
  22.  
  23.                
  24.  
  25.             }
  26.             catch (Exception ex)
  27.             {
  28.                 throw new ApplicationException(String.Format(
  29.                     "A snapshot could not be generated for the {0} publication."
  30.                     , publicationName), ex);
  31.             }
  32.  
  33.        }

--onpnt 01:19, 30 December 2010 (GMT)

812 Rating: 3.2/5 (9 votes cast)