From my DAL, How can i read a connection string from the web.config?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Yuu only need
WebConfigurationManager
if there are several Web.Config files in your project using data connection strings:What's the difference between the WebConfigurationManager and the ConfigurationManager?
You can use the WebConfigurationManager to read connection string value from web.config
Code Example:
Make sure you have added the System.configuration reference to your DAL.