asp.net2.0中读取web.config数据库连接字符串2种方法

方法一:

string myConn = System.Configuration.ConfigurationManager.ConnectionStrings

["sqlConnectionString"].ConnectionString;
方法二:

string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings

["sqlConnectionString"].ToString();

你可能感兴趣的:(Web,asp)