Answered Custom web part that connects to a database/excel sheet?

  • Wednesday, January 06, 2010 8:07 PM
     
     
    I'm using visual studio 2010 beta 2 on W2K8 r2 RTM, and am confounded in finding a guide on how to create a custom webpart that connects to a database or excel sheet.

    Any help / suggestions / books would be most appreciated.

    -Aaron

All Replies

  • Wednesday, January 06, 2010 10:08 PM
     
     Answered
    Connecting to an Excel sheet is not recommended. Excel is not a multi-user database.

    Connecting to a database inside a web part is no different than connecting to a database in other .Net programs. However, you should use the SPWebConfigModification class and an event receiver to update web.config.
    • Proposed As Answer by Aviw_ Monday, March 05, 2012 10:34 AM
    • Marked As Answer by Margriet Bruggeman Friday, March 30, 2012 9:45 AM
    •  
  • Thursday, January 07, 2010 6:07 PM
     
     
    Thank you very much Paul,

    Follow up question is to help direct me towards a resource that will further elabortate on the implications, utility, and implimentation of SPWebConfigModification and how to use event receivers.


    -Aaron
  • Thursday, January 07, 2010 7:35 PM
     
     Answered

    The process is not different than previous versions of SharePoint.

    http://www.bing.com/search?q=spwebconfigmodification

  • Friday, January 08, 2010 8:21 AM
     
     Answered

    The best practices way is to connect via bdc and generate xml aplication definition file database or web services connection. Import the ADF file to MOSS SSP and then connect the LOBInstance data to Business Data Web Parts.

    Hope this helps

    • Proposed As Answer by Aviw_ Monday, March 05, 2012 10:35 AM
    • Marked As Answer by Margriet Bruggeman Friday, March 30, 2012 9:45 AM
    •