Dynamic database connections

Topics: General Discussion Forum
Jun 29, 2007 at 11:05 PM
We use a model where the connection strings used to connect to data sources are provided by a class in an assembly of utility classes. Generally, the connection strings are derived from information contained in a non-standard XML settings file as opposed to the app.config file as specified in the default behavior of the software factories. Is it possible to modify the guidance package to utilize a public member of an existing class as a means of obtaining a connection string and other connection information? I understand that the strings can be encrypted in the app.config using the default options and behavior, but what about customizing the guidance and factory packages?
Developer
Jul 2, 2007 at 3:22 PM
you may certainly update the t4 templates that generates code that uses the connection string and replace that with your own internal class. It should be fairly easy to get these temaplates (tipically in the Data Access Guidance Package, Templates folder) and do the change. You don't even need to recomplile the package since you are updating a template file.
Jul 3, 2007 at 5:01 AM
Thank you. I will have to go ahead and do that. The general model with data, business and service providers is very similiar to the one we have been using with WSE3.0. If I can change the names and other things in the guidance package, that'll be less code to change after the wizards generate it.

Is there any tutorial for going through the process of editing a package? I see that the WCF version of the HOL hase something regarding this. Is this the best source for guidance on guidance?
Developer
Jul 5, 2007 at 4:20 AM
You may use the HoL as a source, along with the GAX HoL and forums as well.