关于WinForm App.config的配置问题.
请求高手大哥大姐,教我在App.config文件里怎么配置Sql数据库的连接呀,还有怎么用配置的连接呀?谢谢了!!!! --------------------编程问答-------------------- <?xml version="1.0" encoding="utf-8" ?><configuration>
<appSettings>
<add key="dsn" value="Server=127.0.0.1;uid=sa;pwd=;database=YDQiangJing"/>
</appSettings >
</configuration> --------------------编程问答-------------------- 上面那个是在App.Config 里面写的东西
链接代码:
(老版的)
public string connstr = System.Configuration.ConfigurationSettings.AppSettings["dsn"];
(新版的)
public string connstr = System.Configuration.ConfigurationManager.AppSettings["dsn"];
补充:.NET技术 , C#