Coded Catalog Overwrites

Posts   
 
    
MPW
User
Posts: 27
Joined: 28-Aug-2007
# Posted on: 23-Aug-2009 13:59:09   

I've looked at a few threads relating to catalog overwrites on SQL2005 and I was wondering if there is a way to force the generated code to use the catalog specified on the connections string without using the XML config files below.

<sqlServerCatalogNameOverwrites> <add key="OldNameCatalog1" value="" /> </sqlServerCatalogNameOverwrites>

I use my own encrypted config file which contains the connection string and I set the DbUtils.ActualConnectionString at application startup, so it would be handy to always use the catalog set in the connection string.

Thanks, Mark

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Aug-2009 20:38:02   

In SelfServicing that's the only way (putting that lines into your .config), AFAIK. Is there any problem in including this in your .config file?

David Elizondo | LLBLGen Support Team
MPW
User
Posts: 27
Joined: 28-Aug-2007
# Posted on: 24-Aug-2009 11:03:50   

Using the config file to prevent catalog overwriting is fine for testing but not a good idea for a production application (IMHO). If the config gets deleted the catalog may change without the connection string being changed and if the userid/pw has access to more than one catalog - chaos ensues!

Do you know when the config gets read and by which bit of code - I presumed it was in the ORMSUpport classes or the SqlDQE.

Thanks M

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 24-Aug-2009 11:23:42   

Do you know when the config gets read and by which bit of code - I presumed it was in the ORMSUpport classes or the SqlDQE.

It's read in the static CTor of the SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine class