I am trying to create a set of CSLA business objects that use a db connection that is not hard coded, i.e. read from an administrative database (whose connection string will be hard coded). This will allow me to publish the same code for all customers without having to manually update the dbconnection string for each.
Any thoughts on the best way to accomplish this?
Thanks for your question / response!
I have a package software product that I publish to a number of different customers. Each customer has their own database which I house and maintain on our servers (ASP model), so when I publish updates, I have to go in an manually update the business classes to connect to the correct customer database. Today, I do that by creating a number of 'named' database connections in the config file (using MS Enterprise Library for data access), each with their own connection string and I hard code the named database connection into the business objects.
I want to be able to have the user connect to an 'admin' database and log in there. From there, it will pull the correct named database string for that customer and use that for all business object datbase connections.
Since these objects are mobile and running on the database server when data access is done, the only way I see to do this now is to just pass the named database connection to each object during its creation. That will work but seems awkward to me. I am wondering if there is a more elegant way this is typically handled. I assume many others have had to do something similar.
Thanks.
Copyright (c) Marimer LLC