1
Answer

C# Replication

prabha

prabha

13y
2.6k
1
Hi ,

 I am doing the replication programatically. It is working fine. But while adding the filter in the replication ,I have the following issue "You must return snapshot,because the snapshot are obsolete".I used the merge pull replication .For the filter i used the following code.

 MergeArticle crewArticle = new MergeArticle();
                    string articleName = "tblAttendance";
                    // Set the required properties for the tblAttendance article.
                    crewArticle.ConnectionContext = publisherConnection;
                    crewArticle.Name = articleName;
                    crewArticle.DatabaseName = publisherConnection.DatabaseName;
                    crewArticle.SourceObjectName = articleName;
                    //crewArticle.SourceObjectOwner = hrSchema;
                    crewArticle.PublicationName = publicationName;
                    crewArticle.Type = ArticleOptions.TableBased;

                    // Define the parameterized filter clause based on Hostname.
                    crewArticle.FilterClause ="CrewID="+ mergePullSubscription.HostName;

                    if (!crewArticle.IsExistingObject) crewArticle.Create();



Thanks
Prabha




Answers (1)