Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Setting article properties for a publication using RMO in C# .NET Expand / Collapse
Author
Message
Posted Monday, May 3, 2010 4:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, May 16, 2010 4:09 AM
Points: 4, Visits: 69
Hello everyone 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 and allow schema changes at subscriber to false and copy foriegn key constarint to true. How do i set the article properties using RMO in C# .NET. I am using Visual Studio 2008.I also want to know as how we can select all the objects including Tables,Views,Stored Procedures for publishing. 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.

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();
Post #914566
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse