Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

RMO - Publication - Article Issues

$
0
0

Hey,

I have the problem, when I create my publication by RMO in c#, that I dont know how or where to change/create the schedule plan for the publication. My code looks like this now:

MergePublication publication = new MergePublication(PublicationName, _settings.RegistryEntries.DbName, GetConnection(true));

publication.SnapshotGenerationAgentProcessSecurity.Login = _settings.SettingsReplication.DomainLoginName;
publication.SnapshotGenerationAgentProcessSecurity.Password = _settings.SettingsReplication.DomainLoginPassword;
publication.SnapshotGenerationAgentPublisherSecurity.WindowsAuthentication = true;

publication.PartitionGroupsOption &= PartitionGroupsOption.False;
publication.SnapshotSchedule.FrequencyInterval = 1;
publication.SnapshotSchedule.ActiveStartDate = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
if (publication.IsExistingObject)
{
  publication.CommitPropertyChanges();
  publication.SnapshotSchedule.Update(); // TODO: not working
}
else
{
  publication.Create();
}

so right now I'm not sure, if I get it wrong what the Update()-function should do, or if there is a bug? because nothing is going to be updated on the server, but there is also no exception.. I tried it without the commitchanges, I tried it in all combinations, but it never updates the interval and startdate..

and if dont change it in the publication, where do I change it?

and in this article it reads like it was designed for it: http://technet.microsoft.com/de-de/library/microsoft.sqlserver.replication.replicationagentschedule.update%28v=sql.105%29.aspx

ah and database-version is 2008 R2 with SP2 and I reference the newest assemblies (Microsoft.SqlServer.Rmo.dll, ... ) with the version: 10.50.400 (SP2)

thx in advance

basto





Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>