Overiding the Catalog name

Posts   
 
    
ddaiker
User
Posts: 2
Joined: 17-Oct-2006
# Posted on: 29-Jan-2007 18:55:26   

I'm using the SelfServing model with the latest LLBL Gen 2.0 and a SQL Server 2005 database. I would like to override the default catalog (database) name at run time. So far the only way I've seen to overrider the catalog name is via a sqlServerCatalogNameOverwrites section in my config file but I need my connection string and database name to be user configurable and hence set at runtime. I've overridden the connection string with the DbUtils.ActualConnectionString setting and was hoping for something similar for the catalog name.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 30-Jan-2007 01:24:59   

You can also specify an empty string for the catalog name in the config file. In that case, the DQE will not specify a catalog name in the generated SQL elements, which will make the SQL target the catalog specified in the connection string.

ddaiker
User
Posts: 2
Joined: 17-Oct-2006
# Posted on: 30-Jan-2007 19:24:35   

Excelent! that's just what I needed. I didn't find that anywhere in the documentation, it might be a good thing to mention.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 31-Jan-2007 03:03:33   

I'm glad it helped. The section of the manual that talks about this is under Generated code - Application configuration through .config files and then the last paragraph before Schema name overwriting (SqlServer/Oracle/DB2/PostgreSql) talks a bit about this scenario if you need any more info.