Setting article properties for a publication using RMO in C# .NET

Posted by Pavan Kumar on Stack Overflow See other posts from Stack Overflow or by Pavan Kumar
Published on 2010-05-13T07:21:48Z Indexed on 2010/05/13 7:24 UTC
Read the original article Hit count: 437

I am using transaction replication with push subscription. I am developing a UI for replication using RMO in C#.NET between different instances of the same database within same machine holding similar schema and structure. I am using Single subscriber and multiple publisher topology. During creation of publication i want to set a few article properties such as Keep the existing object unchanged ,allow schema changes at subscriber to false a,copy foriegn key constarint and copy check constraints to true. How do i set the article properties using RMO in C# .NET. I am using Visual Studio 2008 SP1.I also want to know as how we can select all the objects including Tables,Views,Stored Procedures for publishing at one stretch. I could do it for one table but i want to select all the tables at one stretch. This is the code snippet i used for selecting single table for publishing.

TransArticle ta = new TransArticle(); ta.Name = "Article_1";

ta.PublicationName = "TransReplication_DB2"; ta.DatabaseName = "DB2";

ta.SourceObjectName = "person"; ta.SourceObjectOwner = "dbo";

ta.ConnectionContext = conn; ta.Create();

© Stack Overflow or respective owner

Related posts about set

Related posts about Article