asp.net 三层中DAL读取Web.config配置文件

在DAl层中添加一下引用:


添加引用:

using System.Web.Configuration;


web.config中连接数据库的字符串:



获得web.config中连接数据库的字符串:

 private static readonly string MySqlConnectionString = WebConfigurationManager.ConnectionStrings[“mysqlconnstring”].ToString();

上一篇 超链接target属性的取值和作用
下一篇 asp.net中获取某种控件在页面中的数量