Hello
I use the table adapter in Visual Studio 2008 to access database, and my application has several databases, all duplicated with the same structure (same tables and same stocked procedures)
I have web services wich will point at a specific database by looking the parameter in the web service
I can't put several connection strings in the web.config file, and i don't want to
and i don't want to pass the connection string in parameters of all methods to the DAL
I would like to modify in the web service directly the connection that the DAL will use , in the context of this web service
so that i don't have to change my DAL and modifiy the "Connection" property on my table adapter
i tried this :
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Web.config");
config.ConnectionStrings.ConnectionStrings[0].ConnectionString =;"Data Source=PC22;Initial Catalog=TEST;User ID=sa;Password=sa";
but it won' work because it's read only