日期:2014-05-18  浏览次数:20473 次

ASP.NET 中.怎样样得到Web.Config 中的连接数据库字符串????C#
ASP.NET   中.怎样样得到Web.Config   中的连接数据库字符串????
用C#  
<connectionStrings>
<add   name= "CorpDataConnectionString "   connectionString= "Data   Source=60.*.*.*;Initial   Catalog=CorpData;Integrated   Security=True; "   providerName= "System.Data.SqlClient "/>
</connectionStrings>


------解决方案--------------------
WebConfigurationManager.ConnectionStrings[ "CorpDataConnectionString "]

WebConfigurationManager.GetSection( "connectionStrings ")

------解决方案--------------------
private static string constr=System.Configuration.ConfigurationSettings.AppSettings[ "CorpDataConnectionString "];