Click here to Skip to main content
15,908,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i store connection string in machine.config in .net
Posted
Comments
Philippe Mori 5-May-12 7:27am    
Why would you do that. As far as I know, it won't work with shared hosting. By the way, you can read the documentation for those configuration files or try it yourself.
Sandeep Mewara 5-May-12 8:20am    
There is a reason why we have different config files. I would not suggest you to put connection string in machine config file even if possible.

1 solution

Yes, you can. But it is not a good idea to do so. Machine.config is used by all applications, even ones that should not have access to your connection string. Generally connection strings only apply to one application and should be stored in the config file for that application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900