首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

解决C#类库摘引web.config下的数据库连接名

2012-06-27 
解决C#类库引用web.config下的数据库连接名在类库中添加引用System.Configuration在cs中也要用using Syst

解决C#类库引用web.config下的数据库连接名
在类库中添加引用
System.Configuration;

在cs中也要用using System.Configuration;

获得链接名
public  static   String ConnectionStr = System.Configuration.ConfigurationManager.ConnectionStrings["name"].ConnectionString;

最后在你的web端添加你的类库引用就可以了

热点排行