SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Sharepoint 2010 , How to connect between two document libraries in different webapplications using BCS?. The webapplications has sitecollections and sites in it and the sites are getting created programmatically through custom UI.The document libraries mentioned above are situated in the programmatically created sites.

share|improve this question
what do you mean by "connect the libraries"? – Marius Constantinescu - MVP Oct 31 '12 at 18:19
i need to replicate the content of the document library 1 to document library 2. – Anu Oct 31 '12 at 19:41
0down votefavorite In sharepoint 2010, Need to have a document library in a site and another document library in another site and the 2nd document library should be an exact copy of the 1st document library(with the doucments) in it. When 1st document library is updated with documents , 2nd document library should also populated with the changes made in document library 1. What is the best way to do this? – Anu Oct 31 '12 at 19:41
up vote 1 down vote accepted


You should create an Event Receiver on your 1st Document Library and pro-grammatically perform the changes on the 2nd document library...

Read about Event Receivers here

And inside the ItemAdded or ItemUpdated event, you can replicate the changes programmatically to the 2nd document library, pseudo code can look like:

public override void ItemAdded(SPItemEventProperties properties)
    if (properties.ListTitle == "FirstDocumentLibrary")
        using (SPSite oSiteCollection = new SPSite(strUrl))
             using(SPWeb oWebsite = oSiteCollection.OpenWeb())
                 //Get file from properties.ListItem

                 //Upload file code
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.