CodeSmith Community
Your Code. Your Way. Faster!

Dynamic Connection strings with multiple tiers.

Latest post 02-09-2008 12:28 PM by SuperJeffe. 1 replies.
  • 02-07-2008 10:33 PM

    • Dominion
    • Not Ranked
    • Joined on 06-25-2007
    • Posts 4
    • Points 80

    Dynamic Connection strings with multiple tiers.

    Hi all 
    I have 4 database hooked up working well in my project.
    However I have a heap of identical databases that i need to connect to dynamically at runtime.

    What is the easiest way to connect to each of these databases at runtime.

    I have seen that i can create a new connection at run time using this. The genericConnection string holds the connection to this particular database i want.
    ClinicConsoleV2ChildSite.Data.DataRepository.AddConnection("CustomChildsite", genericConnection);

    However how do i tell ClinicConsoleV2ChildSite that i want its default connection to be CustomChildsite?

    Or is the above line all that is needed to add and set it in one go. So now any transactions i make to ClinicConsoleV2ChildSite will now effect the CustomChildsite database.

    Another thing is there a way to make the stored procedures global to all these identical databases or doi have to add them to 800+ databases? Urgh.

     Cheers
    Dominion.

    • Post Points: 35
  • 02-09-2008 12:28 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 325
    • Points 8,135

    Re: Dynamic Connection strings with multiple tiers.

    Reply |Contact |Answer

    Look at this discussion:

    http://community.codesmithtools.com/forums/p/7964/29551.aspx#29551

    It will show you how to tell the DataRepository how to connect to which database and kind of a discussion on how to best handle this.

    Jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems