Skip to content

C# Replication

prabha

Asked May 9, 2011, 6:43 PM EDT1 answer
Share
LinkedInX
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




1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
    You need to rerun the snapshot agent to create up to date snapshot files.
    0