Dynamic addition to PersistenceInfoProvider.cs

Posts   
 
    
Posts: 24
Joined: 19-Feb-2007
# Posted on: 24-May-2010 01:15:21   

Hello,

I've modifed the PersistenceInfoProvider.cs, to allow for dynamic connections to different databases.

private static string ActualDataBaseName = DbUtils.ActualDataBaseName;

So I replaced all the references to the db name (i.e. "Northwind") with the string variable above (ActualDataBaseName which I made static along side of the DbUtils.ActualConnectionString)

The 1st time I connect to a collection, it works, then I change the connection info via the above variables, and the connection string changes but the ActualDataBaseName does not update the PersistenceInfoProvider.

I guess this is because the PersistenceInfoProvider only gets called once in the beginning. Is there a way to force reload of the PersistenceInfoProvider with the new DBName?

Maybe a better question is How do i change the catalog name dynamically without the config file method. I have a bunch of identical databases with different names, that would use the same dll .

thx !stuck_out_tongue_winking_eye

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-May-2010 05:27:28   

Hi there,

I think you are looking in the wrong pattern as SelfServicing is not designed for multiple dynamic connections. Anyway please attach or post the code you have so far to understand what you are trying to reach and see if there is a solution for this.

David Elizondo | LLBLGen Support Team
Posts: 24
Joined: 19-Feb-2007
# Posted on: 24-May-2010 21:26:20   

Hello daelmo,

Thank you for the new direction, I have not investigated Adapter pattern. Let me take a look at that approach since I am still in the development phase.