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.
RMO Load Publisher Properties
From Wiki
Use this base method to build your own for loading publisher properties for Merge Replication using RMO. The example shows how you can return the Snapshot folder for the publisher.
- public void LoadPubProperties()
- {
- string publicationName = <publication name>;
- string publisherName = <instance the publisher is located on>;
- string publicationDbName = <publication database>;
- MergePublication publication;
- ServerConnection conn = new ServerConnection(publisherName);
- try
- {
- conn.Connect();
- publication = new MergePublication();
- publication.ConnectionContext = conn;
- publication.Name = publicationName;
- publication.DatabaseName = publicationDbName;
- publication.CachePropertyChanges = true;
- if (publication.LoadProperties())
- {
- snapLoc = publication.BrowseSnapshotFolder().ToString();
- }
- else
- {
- throw new ApplicationException(String.Format(
- "Settings could not be retrieved for the publication. " +
- "Ensure that the publication {0} exists on {1}.",
- publicationName, publisherName));
- }
- }
- catch (Exception ex)
- {
- throw new ApplicationException(
- "The publication property could not be changed.", ex);
- }
- finally
- {
- conn.Disconnect();
- }
- }
--onpnt 01:12, 30 December 2010 (GMT)



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