Last post Nov 15, 2010 03:25 AM by Wencui Qian - MSFT
Nov 10, 2010 03:50 AM|mhbrown|LINK
Sure this is probably a simple problem to resolve but I am a little stuck!
I will explain the my current yet simple architecture of my application(s). At the moment I have my main web application as a separate project. I then reference the CoreBLLDAL (Business Logic and Data Access) Project so that several
projects can have access to the BLL/DAL Project.
Within the CoreBLLDLL Project I use TableAdapters for my DAL.
I have just upgraded to VS2010 and I would like to make use of the Config Transforms, allowing me to have a separate web.config for test and production - however, TableAdapter get the connection string from the Settings.settings file.
How can I change the TableAdapters to get the connection string from the app/web.config file? I read that you can change this within the designer file for the TableAdapters by using ConfigurationManager, however, I tried this but
I do not have access to the ConfigurationManager namespace. I presume this is because the project is a class library and not a web application - I am not too sure.
All help appreciated. Thanks in advance.
Nov 15, 2010 03:25 AM|Wencui Qian - MSFT|LINK
Just try to set a new connection string in web.config with the same name of the one in DLL, then the one in DLL will be overrided. Please try it first and see whether it works. Thanks.