当前位置: 代码迷 >> ASP.NET >> .net2.0里怎么读写Web.config的连接字符串
  详细解决方案

.net2.0里怎么读写Web.config的连接字符串

热度:9487   发布时间:2013-02-26 00:00:00.0
.net2.0里如何读写Web.config的连接字符串?
RTRT

貌似和1.0不一样了嘛

<add> 标签不好使了..

------解决方案--------------------------------------------------------
ConfigurationManager.ConnectionStrings[ "SQLConnString1 "].ConnectionString;
读取
<connectionStrings>
<add name= "SQLConnString1 " connectionString= "server=serverjh;uid=sa;pwd=slfjsdlkfjsdjasldjaskldjals;database=abcdefd "
providerName= "System.Data.SqlClient " />
</connectionStrings>


  相关解决方案