开发者

storing multiple connection string in xml file asp.net

开发者 https://www.devze.com 2023-01-20 02:47 出处:网络
Based on company and unit selected by开发者_运维知识库 user i have to select connection string. I want to know what is the best practice to store multiple connection string. Should i store it in XML f

Based on company and unit selected by开发者_运维知识库 user i have to select connection string. I want to know what is the best practice to store multiple connection string. Should i store it in XML file or web.config file? or at any other place.

Thank you very much


We have some legacy systems that run different databases, than our "official" system. I have always stored the different connection strings in the webconfig, and selected the one I need, in my code.

ConnectionString = WebConfigurationManager.ConnectionStrings["PDM"].ConnectionString;

Personally, I would keep it all in web.config.

0

精彩评论

暂无评论...
验证码 换一张
取 消