PersistenceInfoProvider hardcoded DB name

Posts   
 
    
Posts: 2
Joined: 24-Oct-2006
# Posted on: 24-Oct-2006 15:33:49   

We ran into a funny thing today with the generated code. We have 2 databases, with exactly the same structure, just a different name. When you change the Main.ConnectionString from the old name to the new one, the code will still connect to the old database, because the database name is hardcoded into the PersistenceInfoProviderCore class. Is this by design? I can imagine that if people want to change their database name, (after development or something) they wouldn't want to go and do a full regenerate with a NEW LLBLGen project...

P.S. this is in the 2.0 version, in the latest .NET runtime, with SelfServicing templates.

Example:

private void InitMyEntityMappings() { base.AddElementMapping( "MyEntity", "DBName", @"dbo", "TableName", 5 ); ...... }

Posts: 2
Joined: 24-Oct-2006
# Posted on: 24-Oct-2006 16:02:22   

Sorry, found the answer through some searching....

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 24-Oct-2006 16:21:10   

Just for reference then, the user manual explains how to handle that in the following section: Generated code - Application configuration through .config files