在Web.config文件中那一行添加<add key="xxx">这种标题?我添加总是错的? 在Web.config文件中那一行添加<add key="xxx">这种标题?我添加总是错的? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <appSettings> <add key="ConnectionString" value="data source=Meng;initial catalog=Document;user id=sa;password=123456;packet size=4096 ;"></add> </appSettings> 下面是在 DBHelper.cs 类中: public static string ConnectionString=System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];我也是在csdn 里面收录的,发给你看看吧 <?xml version="1.0" encoding="utf-8"?><configuration> <appSettings/> <connectionStrings/> <system.web> <!-- 设置 compilation debug="true" 可将调试符号插入 已编译的页面中。但由于这会 影响性能,因此只在开发过程中将此值 设置为 true。 --> <compilation debug="false"> </compilation> <!-- 通过 <authentication> 节可以配置 ASP.NET 用来 识别进入用户的 安全身份验证模式。 --> <authentication mode="Windows" /> <!-- 如果在执行请求的过程中出现未处理的错误, 则通过 <customErrors> 节可以配置相应的处理步骤。具体说来, 开发人员通过该节可以配置 要显示的 html 错误页 以代替错误堆栈跟踪。 <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> </system.web></configuration>这是默认的。写在那个位置呢? 一个比较通用的 Web.config配置 http://blog.sina.com.cn/s/blog_5ea9354f0100dhrf.html <appSettings/> 你的默认里有这个 你把这个改成一对就可以了或者你也可以用 楼上的 那个 是比较好的了 如果楼主要在web.config中自定义配置节点.必须要有实现IConfigurationSectionHandler接口的类...http://blog.csdn.net/ojekleen/archive/2008/12/17/3540567.aspx |zyciis| 要命问题 Javascript 浮点运算数据不对 这是怎么回事 在使用 WF 工作流中 Linq to sql 的序列化问题 求助:淘宝api使用请教 如何用IE自带的ActiveX控件(WebBrowser)实现Web打印? ExecuteReader: Connection 属性尚未初始化。 如何解决 求高手指教 谢谢了 请教 关于User的问题 2 asp.net2.0 treeview 自定义图像和连线 简单问题,怎样判断一个字段是否为NULL!!! 怎样后台设置方本框的边框颜色(input,textbox) cookie怎样用在登录
<add key="ConnectionString" value="data source=Meng;initial catalog=Document;user id=sa;password=123456;packet size=4096 ;"></add>
</appSettings>
下面是在 DBHelper.cs 类中:
public static string ConnectionString=System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
我也是在csdn 里面收录的,发给你看看吧
<appSettings/>
<connectionStrings/>
<system.web>
<!--
设置 compilation debug="true" 可将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="false"> </compilation>
<!--
通过 <authentication> 节可以配置 ASP.NET 用来
识别进入用户的
安全身份验证模式。
-->
<authentication mode="Windows" />
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。 <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
--> </system.web></configuration>
这是默认的。
写在那个位置呢?
http://blog.sina.com.cn/s/blog_5ea9354f0100dhrf.html
http://blog.csdn.net/ojekleen/archive/2008/12/17/3540567.aspx