locked
Can i access database of content on different site collections? RRS feed

  • Question

  • Hi guys,

     

    Need some help for accessing database.

    Here is my problem. I have created contacts in 3 locations. Let say http://home/spsite, http://home/spsite2 and http://home/spsite3. 

    at spssite, i have created contacts search. All contacts informations are there in one database.

    at spsite2, i have created contacts by tree view with sub category.

    at spsite3, i have created contacts with B'D for B'D view of all members.

     

    Questiong is that i want to write the code or any possible way for modifying DB content on all site collections when i add or delete him on http://home/spsite. Is it possible? If so, pls guide me. Thank you before hand.

     

    WSS 3.0, database embedded mssql 2005 microsoft##ssee

    Tuesday, February 15, 2011 5:06 PM

Answers

  • If I understand correctly you have a 3 subsites and each of the subsites has its own contact list. You want to maintain same contacts in all the lists.

    What you can do is, allow modifying of contacts, adding and deleting only in one of the sites. You can do this by maintaining appropriate permissions.

    Then you will need to make use of event handlers to synchronize the contacts across the sites. You can write event handlers for Item Added, Edited and Deleted event. So when ever you add a contact to Site 1 it will get automatically added to Site 2 and 3 as well.

    I hope this helps!


    Regards, Mahesh
    • Marked as answer by Leoyi Sun Wednesday, February 23, 2011 2:49 AM
    Tuesday, February 15, 2011 11:36 PM
  • You will have to make use of visual studio and C#/VB.Net to write code for event handlers. Workflows can help here but I think workflows cannot be triggered on delete. You can try a SPD workflow for item add and edit events. More details on event handlers can be found here http://msdn.microsoft.com/en-us/library/ms453149.aspx

    You should also look at why you need to have the same contact list across three sub sites? Using SPD you can access data which reside in other sites.

    Regarding the second question on DB, I guess you are trying to add an external database as a data source for creating data view web parts, is that right? Try accessing that database first from some other client software like, infopath or MS Access etc.

     


    Regards, Mahesh
    • Marked as answer by Leoyi Sun Wednesday, February 23, 2011 2:49 AM
    Wednesday, February 16, 2011 7:34 PM

All replies

  • If I understand correctly you have a 3 subsites and each of the subsites has its own contact list. You want to maintain same contacts in all the lists.

    What you can do is, allow modifying of contacts, adding and deleting only in one of the sites. You can do this by maintaining appropriate permissions.

    Then you will need to make use of event handlers to synchronize the contacts across the sites. You can write event handlers for Item Added, Edited and Deleted event. So when ever you add a contact to Site 1 it will get automatically added to Site 2 and 3 as well.

    I hope this helps!


    Regards, Mahesh
    • Marked as answer by Leoyi Sun Wednesday, February 23, 2011 2:49 AM
    Tuesday, February 15, 2011 11:36 PM
  • Are you asking ways to access user profiles directly in SharePoint content DB
    Wednesday, February 16, 2011 4:45 AM
  • If I understand correctly you have a 3 subsites and each of the subsites has its own contact list. You want to maintain same contacts in all the lists.

    What you can do is, allow modifying of contacts, adding and deleting only in one of the sites. You can do this by maintaining appropriate permissions.

    Then you will need to make use of event handlers to synchronize the contacts across the sites. You can write event handlers for Item Added, Edited and Deleted event. So when ever you add a contact to Site 1 it will get automatically added to Site 2 and 3 as well.

    I hope this helps!


    Regards, Mahesh

    yes you are right. But how do i make use of event handlers? where should i write? with SPD? Never heard before. Please write details instruction for dammy :P. Thank you. BTW I know how to write workflow on SPD. 

    And I am trying to add database from SPD, my DB is at the same domain and call CRM\microsoft##ssee. Default DB when i installed WSS 3. But i can't add that DB in SPD. Why? with user, without user, same problem. Can't access DB.

    Wednesday, February 16, 2011 8:42 AM
  • @prasad06k 


    no. 

    Wednesday, February 16, 2011 8:52 AM
  • You will have to make use of visual studio and C#/VB.Net to write code for event handlers. Workflows can help here but I think workflows cannot be triggered on delete. You can try a SPD workflow for item add and edit events. More details on event handlers can be found here http://msdn.microsoft.com/en-us/library/ms453149.aspx

    You should also look at why you need to have the same contact list across three sub sites? Using SPD you can access data which reside in other sites.

    Regarding the second question on DB, I guess you are trying to add an external database as a data source for creating data view web parts, is that right? Try accessing that database first from some other client software like, infopath or MS Access etc.

     


    Regards, Mahesh
    • Marked as answer by Leoyi Sun Wednesday, February 23, 2011 2:49 AM
    Wednesday, February 16, 2011 7:34 PM
  • You will have to make use of visual studio and C#/VB.Net to write code for event handlers. Workflows can help here but I think workflows cannot be triggered on delete. You can try a SPD workflow for item add and edit events. More details on event handlers can be found here http://msdn.microsoft.com/en-us/library/ms453149.aspx

    You should also look at why you need to have the same contact list across three sub sites? Using SPD you can access data which reside in other sites.

    Regarding the second question on DB, I guess you are trying to add an external database as a data source for creating data view web parts, is that right? Try accessing that database first from some other client software like, infopath or MS Access etc.

     


    Regards, Mahesh

    I think i need to access buildin DB for using VS C# for event handlers. isn't?

     

    I need to use same contact coz company need tree view and search contact. One is for Birthday on Home page. I can't access contacts list from home page which is on other site collection. So i made new list contacts :(. So i got 3 same contact with different fields. one is with B'D, one is all contacts, and the other one is for tree view with different categoy(notes).

    So when someone from admin delete or modify at treeview, i want to get data fields what he wants to modify, then change the other site collections with that modifying data. Is it possible? Or is there any other way to connect with one contact list from different site collections?

    Wednesday, February 16, 2011 7:52 PM
  • any reply? :(
    Sunday, February 20, 2011 11:35 PM