Database Connection String

Posts   
 
    
johnfattal
User
Posts: 6
Joined: 14-Feb-2007
# Posted on: 13-Mar-2007 15:08:43   

Adapter .NET 2.0. LLBLGen 2.0.0.0 Database : Sql Server 2005

The database connection string in my app.config file does not seem to be driving which database to use. On further inspection it looks like the database name is hardcoded in PersistenceInfoProvider. Is there some kind of property that can be set to change this?

The scenario is that I am using a different database on the same server for my unit tests which destroys and recreates test data.

Aurelien avatar
Aurelien
Support Team
Posts: 162
Joined: 28-Jun-2006
# Posted on: 13-Mar-2007 15:43:19   

Hi,

Are you using SelfServicing or Adapter ?

if you use Adapter, you can check this page on the doc : Generated code - DataAccessAdapter Functionality, Adapter

see the CatalogNameToUse feature.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 13-Mar-2007 20:14:48   

There is also another way to overwrite catalog information, which is also required if you have multiple catalogs in your project. Please see Using the generated code -> Application configuration through .config files in the LLBLGen Pro manual for more details.

spatches
User
Posts: 8
Joined: 20-Feb-2007
# Posted on: 30-Jul-2007 16:34:55   

Why did this change in 2.0? I don't think 1.x needed any workaround when you changed the connection string to point to a different database.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 31-Jul-2007 06:25:22   

As a matter of fact, v1.x comes with Catalog name overwriting and Schema name overwritingsimple_smile (see v1.x documentation).

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 01-Aug-2007 10:36:41   

spatches wrote:

Why did this change in 2.0? I don't think 1.x needed any workaround when you changed the connection string to point to a different database.

It did change because the information is now static and shared among fields, reducing the memory footprint of entities. If you want to control the catalog from the connection string, overwrite the catalog name with "", using catalog name overwriting.

Frans Bouma | Lead developer LLBLGen Pro