标签:ons tab 方法 data conf blog 字符 数据库连接字符串 logs
写法:
<configuration> <appSettings> <add key="connectionstring" value="server=127.0.0.1;uid=sa;pwd=123456;database=Power"/> </appSettings> </configuration>
调用:
string rode= System.Configuration.ConfigurationSettings.AppSettings["connectionstring"];
写法:
<connectionStrings> <add name="CONNECTIONS" connectionString="Server=10.10.10.1;Database=MyDBTest;Uid=sa;Pwd=sa" /> </connectionStrings>
调用:
string connectionstr = System.Configuration.ConfigurationSettings.AppSettings["CONNECTIONS"];
sql数据库连接字符串在APP.config配置文件内的两种写法
标签:ons tab 方法 data conf blog 字符 数据库连接字符串 logs
原文地址:http://www.cnblogs.com/yunquan/p/7383386.html