Rename catalogs using the multi-name-setting

Posts   
 
    
hypo
User
Posts: 34
Joined: 14-Oct-2008
# Posted on: 23-Nov-2009 18:15:19   

Hi all,

Could someone provide me with an example of multi name setting? I have 2 catalogs in my llblgen-file. MDMMaster and MDMBlob.

I would like to change these catalog names for testing purposes. How do I change these catalogNames to MDMMaster_TEST and MDMBlob_TEST?

(Not by regenerating the code but by using muti name setting). I found the description in the helpfile, but I'm not sure how to implement it without a concrete example.

Helpfile text:

Multi name setting Preferred way of performing catalog name overwriting. To do this, create a new CatalogNameOverwriteHashtable (type provided by the SD.LLBLGen.Pro.ORMSupportclasses assembly). You can specify a CatalogNameUsageSetting, but this isn't required. You then add key-value pairs, where the key is the name to overwrite and the value is the name to overwrite it with. If you specify '*' as key, all catalog names will be set to the name specified as value, if CatalogNameUsageSetting is set to ForceName. Please see the LLBLGen Pro reference manual for more details on this object. The created CatalogNameOverwriteHashtable is then passable to the DataAccessAdapter constructor or you can set the CatalogNameOverwrites properties to an instance of this special hashtable.

Thanks alot, Kind regards, Wim

rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 23-Nov-2009 18:56:51   

Hi Wim -

What I do is keep a single catalog name in the LLBLGen Designer, since I use a single database for development.

Then for testing and deployment I use catalog name overwriting using the Connection string. I've found this to be the most flexible for my needs. Because I have different web.configs for each environment, all I need is the correct connection string, and LLBLGen will be pointed to the correct database.

To do this, simply add this to your .config file:

<configSections>
      <!--// LLBLGen Catalog Name Overwriting (Live, Test, Dev) // -->
      <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <sqlServerCatalogNameOverwrites>
    <!--// LLBLGen Catalog Overwrite (Live, Test, Dev, DevLocal) //-->
    <!--// Use ConnectionString for Database Name //-->
    <add key="PUT-LLBLGen-DESIGNER-DATABASE-NAME-HERE" value="" />
  </sqlServerCatalogNameOverwrites>

Hope this helps!

Ryan