sqlServerCatalogNameOverwrites doesn't seem to work during development

Posts   
 
    
Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 12-Dec-2007 21:50:01   

Hi, I'm using LLBL 2.5 Selfservecing , SQL 2005 DB and ASP.NET 2.0. Now when I'm developing I'm using a certain DB to generate the code for LLBL. This is all fine and I know in the generated code the Catalog name is stored. But now I restored an older version om my db to a new DB and I want this new DB to use for debugging my current code. Which is still not changed. (I mean the old DAL is still there and should work against this DB). For this purpose I added


<configSections>
        <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </configSections>

    <sqlServerCatalogNameOverwrites>
        <add key="OldDB" value="NewDB"></add>
    </sqlServerCatalogNameOverwrites>
    

To my config. But when I debug my app I see that the connectionstring is pointing to the right new dB but the SP's and entity seem to reference the old DB which is still present but not used at that moment. So it seems the overwrite part doesn't when debugging. But I think I missed something but I don't know what. Any help is appreciated.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Dec-2007 04:47:03   

This is supposed fixed in v2.5 so we are investigating this. In the meantime please include the _newDB _name in the connection string

David Elizondo | LLBLGen Support Team
Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 13-Dec-2007 09:56:40   

hi Daelmo,

I already changed the connection string to the new DB. In short:

  • The connectionstring in pointing to the new DB
  • I added sqlServerCatalogNameOverwrites to my web.config.

I even tried this option leaving the newDB value in this sqlServerCatalogNameOverwrites blank so it would automatically get the Catalog name I defined in my connectionstring.

I know the sqlServerCatalogNameOverwrites works when the applications is deployed, because I used that for an other app. But I want to use it in design time for debugging purpose.

Now when I debug I can see that the connectionstring used is correct, meaning pointing to the new DB, but since the new DB is in the same instance of the Old DB, the queries do work because they are referenced.

Any other suggestions?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 13-Dec-2007 10:25:16   

Which LLBLGen Pro runtime library are you using?

Now when I debug I can see that the connectionstring used is correct, meaning pointing to the new DB, but since the new DB is in the same instance of the Old DB, the queries do work because they are referenced.

What do you mean by the above lines? Is the CatalogName Overwrites working as long as the new database is in the same server of the old database?

You may use the Designer to rename the catalog in the Catalog Explorer and then do a Refresh to all the catalogs. This should mao your entities to the new DB.