Catalog Name Overwriting - not working?

Posts   
 
    
Posts: 2
Joined: 31-Mar-2008
# Posted on: 31-Mar-2008 20:20:00   

Hi folks,

I've got a project which needs to run against a different catalog name than the one it was built for. Catalog Name Over-writing seems to supply the perfect solution to my situation, however it doesn't seem to work for me, and I'm not sure how to debug it.

Here's what I put int he Web.Config for the project:

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

Still, the code reaches for things in the SP6 catalog rather than the AppEng1 catalog. Here's the error I get when launching a web browser against the application:

An exception was caught during the execution of a retrieval query: The server principal "AppEng1" is not able to access the database "sp6" under the current security context.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.

I should also mention that our connection string is burried in a DLL, so we provide it to the llblgen code at dynamically, rather than specifying it in the web.config.

This is the same error as the one I got before learning about Catalog Name Over-writing. Can anyone tell me what is wrong, or how to go about debugging this?

Many thanks,

spinLock

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 01-Apr-2008 08:43:28   

The following is copied from the manual, please try it out:

Note:
For ASP.NET applications, the section declaration has to contain in the type attribute the full type with version and culture, otherwise you'll get an exception at runtime. The specific type declaration is specific for the .NET version you're using and you can find examples how to specify it from the machine.config file in %WINDIR%\Microsoft.NET\Framework\version\CONFIG. For example for .NET 1.1, SqlServer specific:

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

Or maybe you are using a Synonym type that refers to the old database?

P.S. You posted in the wrong forum.

Posts: 2
Joined: 31-Mar-2008
# Posted on: 01-Apr-2008 20:43:42   

Walaa wrote:

The following is copied from the manual, please try it out:

Note:
For ASP.NET applications, the section declaration has to contain in the type attribute the full type with version and culture, otherwise you'll get an exception at runtime. The specific type declaration is specific for the .NET version you're using and you can find examples how to specify it from the machine.config file in %WINDIR%\Microsoft.NET\Framework\version\CONFIG. For example for .NET 1.1, SqlServer specific:

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

Or maybe you are using a Synonym type that refers to the old database?

P.S. You posted in the wrong forum.

Thanks Walaa - using the correction Version, Culture, PublicKeyToken, and also realizing that the Catalog Name is case-sensitive, solved the problem. And thanks for the 'wrong forum' tip - I'll aim better next time ;-)