当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > asp.net 类库中使用ConfigurationManager.ConnectionStrings

ASP.NET
HTML服务器控件介绍:HtmlInputFile控件
HTML服务器控件介绍:HtmlInputHidden控件
HTML服务器控件介绍:HtmlInputImage控件
HTML服务器控件介绍:HtmlInputRadioButton控件
HTML服务器控件介绍:HtmlInputText控件
HTML服务器控件介绍:HtmlSelect控件
HTML服务器控件介绍:HtmlTable控件
HTML服务器控件介绍:HtmlTableCell控件
HTML服务器控件介绍:HtmlTableRow控件
HTML服务器控件介绍:HtmlTextArea控件
Web服务器控件:AdRotator控件
Web服务器控件:Button控件
Web服务器控件:Calendar控件
Web服务器控件:CheckBox控件
Web服务器控件:CheckBoxList控件
Web服务器控件:DropDownList控件
Web服务器控件:HyperLink控件
Web服务器控件:Image控件
Web服务器控件:ImageButton控件
Web服务器控件:Label控件

ASP.NET 中的 asp.net 类库中使用ConfigurationManager.ConnectionStrings


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-11   浏览: 285 ::
收藏到网摘: n/a

类库中使用ConfigurationManager.ConnectionStrings的步骤。 一直没弄明白怎么在类库中找不到
ConfigurationManager.ConnectionStrings
后面才发现没有添加System.configuration的引用,添加后:

引入命名空间:
复制代码 代码如下:

using System.Configuration;

便可以使用了:
复制代码 代码如下:

public static string ConnectionString = ConfigurationManager.ConnectionStrings["Conn"].ToString();