Can database be switched simply by using web.config?

Posts   
 
    
Posts: 8
Joined: 27-May-2011
# Posted on: 03-Jul-2011 00:34:22   

I had figured that I could switch from development database to production database simply by switching the connection string in the web.config file. However, when I do this, on the production site, I get an error indicating that it can't find an object I was trying to use in a test. Subsequently in looking at the code in the databasespecific project, I see that it puts the name of the database here that for the database that was used in generating the code. Is there a quick way to get around this problem other than regenerating all the code for both environments separately and adding those dlls to the appropriate server?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Jul-2011 22:51:46   

Yes, you should use Catalog name overwriting to point the generated code to the right database. If your production server also uses a different schema (other than 'dbo' for instance) you also have to use Schema name overwriting.

David Elizondo | LLBLGen Support Team