Switching between databases

Posts   
 
    
Yash
User
Posts: 20
Joined: 07-Jan-2010
# Posted on: 09-Feb-2010 08:23:41   

I have generated a c# project using LlBlGen 2.5 with a DB, say myDB in Sql Server 2005. Now is there any way to map myDB_Copy(which is an exact copy of myDB) to previously generated code or do I need to regenerate the code using copied DB? Please suggest.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 09-Feb-2010 09:53:07   
Yash
User
Posts: 20
Joined: 07-Jan-2010
# Posted on: 09-Feb-2010 11:25:09   

I have tried

<configSections> <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler" /> </configSections> <sqlServerCatalogNameOverwrites> <add key="myDBOld" value="myDBNew" /> </sqlServerCatalogNameOverwrites>

With DbUtils.ActualConnectionString="myConnString" as well as <appSettings>, but unable to configure my new DB and getting the error

"[i]SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Invalid object name"

as its still referring to the old DB name.

Walaa wrote:

Just use CatalogName Overwrites

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 09-Feb-2010 11:30:10   

You have added the above config tags to the application config file, right? I mean the executable application's config file.

Yash
User
Posts: 20
Joined: 07-Jan-2010
# Posted on: 09-Feb-2010 11:48:02   

Oh, Thanks a lot Walaa for your suggestions. I have been mixing the app.config settings with two projects, hence not getting the desired results.

Walaa wrote:

You have added the above config tags to the application config file, right? I mean the executable application's config file.