<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="visual studio升级后的数据库连接配置方法" id="card1">
<p> 游客</p><p>
标题:visual studio升级后的数据库连接配置方法<br/>
正文:<br/>
 &amp;quot;在VisualStudio中的数据库连接配置不停的升级，而且每次升级后，使用方式均发生了变化，不知道微软什么时候，能够把这个固定下来。看来为了安全，只有不停的升级。下面是最新的配置和使用方式： vs.net 2005中的ConfigurationManager，代替了原来的configurationsettings。用法大概如下，详细的看MSDN 读取配置： ConfigurationManager.AppSettings[\&amp;quot;MyKey\&amp;quot;]  读取数据库的配置（这个估计大家最经常用了）  在web.config中      在程序中如下读取：   SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[&amp;quot;AppConnectionString1&amp;quot;].ConnectionString);  GETSECTION方法：  ConfigurationManager.GetSection(&amp;quot;mySection&amp;quot;)<br/><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=170&amp;Page=1">[&lt;&lt;]</a><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=170&amp;Page=1">[[1]]</a><a href="http://www.zhongguosou.com/blog/wap.asp?mode=WAP&amp;act=View&amp;id=170&amp;Page=1">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=170">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=170">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://www.zhongguosou.com/blog/wap.asp">首页</a>
</p>
</card>
</wml>