How to set up a testing database

Posts   
 
    
nato24 avatar
nato24
User
Posts: 14
Joined: 10-Apr-2007
# Posted on: 14-Jan-2008 21:43:17   

Hi there,

I created a web application using the selfservice model for my DAL. I now need to be able to clone the production database and create a test instance of it for staging.

How would one go about doing this. I've changed the connection string, but that doesn't work with the generated code that llblgen pro created.

Exception Details: System.Data.SqlClient.SqlException: Server user 'MotorolaDealsTEST' is not a valid user in database 'MotorolaDeals'.

Any ideas of how to work around this?

Thanks, Nathan

tbarton
User
Posts: 10
Joined: 12-Jan-2008
# Posted on: 14-Jan-2008 21:56:55   

Hi, In Self Servicing, you should be able to set a new connectionstring through the property DBUtils.ActualConnectionString (Hopefully this isn't what you've already tried)

DBUtils is a static class. I've forgotten the namespace it's in, I think maybe HelperClasses.

DvK
User
Posts: 323
Joined: 22-Mar-2006
# Posted on: 14-Jan-2008 22:26:42   

If you're using Adapter, then you should also change the CatalogNameOverwrite value in the .config file.

nato24 avatar
nato24
User
Posts: 14
Joined: 10-Apr-2007
# Posted on: 14-Jan-2008 22:38:28   

DvK wrote:

If you're using Adapter, then you should also change the CatalogNameOverwrite value in the .config file.

Thanks for the input, but switching to an adapter model is not an option at this point.

I'm currently experiment with first response. It was just a bit strange because I cloned the production db, restored it with a different name. I created a different sql user and updated my web.config to point to the test db with the new user.

I receive and error saying that the new test user cannot access the live db. The live db name is nowhere to be found in the web.config. A colleague said he had success in the past using the same user for both dbs.

I'll post my results.

Thanks, Nathan

nato24 avatar
nato24
User
Posts: 14
Joined: 10-Apr-2007
# Posted on: 14-Jan-2008 23:54:52   

Hmm, yeah no go. I've tried everything. The only thing that works is to have use the same sql login to connect to a test db.

I'm not a fan of that approach because the user account would have the same rights to the production system which probably isn't a good idea.

Does anyone else have any approaches to this conundrum?

Thanks, Nathan

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Jan-2008 03:04:02   

Hi Nathan,

Now in SelfServicing you have to specify the name overwriting, as the catalog name is generated into the code as well wink

Please refer to LLBLGenPro Help - Using the generated code - Application configuration through .config files - Catalog name overwriting

If you still have troubles please let us know and paste the relevant part of your config file.

Regards,

David Elizondo | LLBLGen Support Team
nato24 avatar
nato24
User
Posts: 14
Joined: 10-Apr-2007
# Posted on: 15-Jan-2008 03:54:00   

Perfect, thanks David, that is exactly what I needed.

nato24 avatar
nato24
User
Posts: 14
Joined: 10-Apr-2007
# Posted on: 15-Jan-2008 04:11:03   

The following line from the doc location David mentioned is very helpful for this scenario.

**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. **

Thanks, Nathan