prabha

prabha

  • NA
  • 1
  • 2.9k

C# Replication

May 9 2011 10:43 PM
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)