從webcongif獲得連接數據庫的字符串
View Code
1 <connectionStrings>
2 <add name="front-end_Web" connectionString="Server=we\Saa;DataBase=database;User ID=sa;Pwd=123" />
3 <add name="back-end_Web" connectionString="Server=we\Saa;DataBase=database1;User ID=sa;Pwd=123" />
4 </connectionStrings>
5
6
7 string conn = System.Configuration.ConfigurationManager.ConnectionStrings["front-end_Web"].ConnectionString;
8 }
本文来自博客园,作者:追夢,转载请注明原文链接:https://www.cnblogs.com/koeltp/archive/2011/12/30/2307799.html