overriding catalogname

Posts   
 
    
mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 12-Mar-2008 13:04:30   

Hello

When using self-servicing you have to add a section to the web.config to override the catalogname.. Why isn't the catalogname used from the DbUtils.actualconnecionstring property?

Thanks

Marco

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 12-Mar-2008 15:09:50   

In general catalog names are hardcoded and not taken from the connection string. This is made to enable the use of entities from more than one catalog. So to override a catalog name you should use the overwrites in the config file.

But if you want to use the catalog specifid in the connection string, then you should specify an empty string as the new value in the catalog overwrites.

LLBLGenPro wrote:

You can also specify an empty string as new name. 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.

mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 12-Mar-2008 20:01:41   

Yes i've read that part of the manual.. but i seems a bit overkill to add several lines of code to the config file, if the same can be done in code, much shorter and easier deployment

Thanks

Marco

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 13-Mar-2008 10:41:05   

I've explained to you why the catalog name is not taken from the connection string by default.

And having to write a couple of lines in the config file once and for all, is not that overkill wink

mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 13-Mar-2008 11:15:46   

Walaa wrote:

I've explained to you why the catalog name is not taken from the connection string by default.

And having to write a couple of lines in the config file once and for all, is not that overkill wink

No, but it can be / become a problem when you have to distribute your app to many clients

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 13-Mar-2008 11:26:36   

mdissel wrote:

Walaa wrote:

I've explained to you why the catalog name is not taken from the connection string by default.

And having to write a couple of lines in the config file once and for all, is not that overkill wink

No, but it can be / become a problem when you have to distribute your app to many clients

No, if you just want to make the code work with the default catalog from the config file, overwrite to an empty string and make that the default in your config file. You then never have to update that part again, just the connection string.

Frans Bouma | Lead developer LLBLGen Pro
Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 13-Mar-2008 11:29:54   

Well if you customize the config file to include the connection string specific to each client deployment, then at the same manner you'd customize the overwrite section.

But if you accept the connection string from the user as an input to the application and you set it at code. Which removes the burden of writing connection strings in the config file at each deployment, then solution of having the overwrite section with an empty string should suit you well as this doesn't need to be changed from deployment to another.

So having an overwrite section with an empty string is not specific per deployment