I looked at the forums and nobody has been able to fully answer the issue regarding being able to dynamic change the value of a connection string at runtime using the netTiers2.cst for .NET 2.0. I have about 50 clients who each have their own database. When a user logs on and accesses the system and goes after any tables generated by CODESMITH and netTiers2 I need to change the SQL catalog in the connection string that represents their (client) specific tables. We have used netTiers2 to generate batches of tables each with their netTierService. Inside each service we have a single client connection. It is this client connection that we need to change dynamically.
If someone could point out how to do this from the provider/datarepository generated code, I will be able to make the changes to the code template. Here are the pertinent sections of my web config, which I have currently working for two batches of tables that I mentioned above.
<configSections>
<section name="netTiersService" type="Ips.Orchestrata.DataObjects.Activity.DataAccessLayer.Bases.NetTiersServiceSection, Ips.Orchestrata.DataObjects.Activity.DataAccessLayer"/>
<section name="netTiersService1" type="Ips.Orchestrata.DataObjects.Position.DataAccessLayer.Bases.NetTiersServiceSection, Ips.Orchestrata.DataObjects.Position.DataAccessLayer"/>
</configSections>
<connectionStrings>
<add name="IPS_Client" providerName="System.Data.SqlClient" connectionString="Data Source=PROTON\ORCHESTRATADEV;Integrated Security=True;Initial Catalog=ipsClient"/>
</connectionStrings>
<!-- neTiers Service providers for DataObjects-->
<netTiersService defaultProvider="SqlClientActivityProvider">
<providers>
<add name="SqlClientActivityProvider" type="Ips.Orchestrata.DataObjects.Activity.DataAccessLayer.SqlClient.SqlNetTiersProvider,Ips.Orchestrata.DataObjects.Activity.DataAccessLayer.SqlClient" useStoredProcedure="true" connectionStringName="IPS_Client" applicationName="OrchestrataWeb" providerInvariantName="System.Data.SqlClient"/>
<add name="SqlNetTiersProvider" type="Ips.Orchestrata.DataObjects.Activity.DataAccessLayer.SqlClient.SqlNetTiersProvider,Ips.Orchestrata.DataObjects.Activity.DataAccessLayer.SqlClient" useStoredProcedure="true" connectionStringName="IPS_Client" applicationName="OrchestrataWeb" providerInvariantName="System.Data.SqlClient"/>
</providers>
</netTiersService>
<netTiersService1 defaultProvider="SqlClientPositionProvider">
<providers>
<add name="SqlClientPositionProvider" type="Ips.Orchestrata.DataObjects.Position.DataAccessLayer.SqlClient.SqlNetTiersProvider,Ips.Orchestrata.DataObjects.Position.DataAccessLayer.SqlClient" useStoredProcedure="true" connectionStringName="IPS_Client" applicationName="OrchestrataWeb" providerInvariantName="System.Data.SqlClient"/>
</providers>
</netTiersService1>
Any help would greatly be appreciated.