private void UpdateConfigFile()
{
var cfg = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
if (cfg.ConnectionStrings.ConnectionStrings["masterConnString"] == null)
{
var elCon = cfg.ConnectionStrings.ConnectionStrings["ElectricConnString"];
cfg.ConnectionStrings.ConnectionStrings.Add(new ConnectionStringSettings { Name = "masterConnString", ProviderName = "System.Data.SqlClient", ConnectionString = elCon.ConnectionString.Replace("Electric", "master") });
cfg.Save();
}
}

最新文章

  1. C语言(函数)学习之index、rindex
  2. include指令和include标签的区别
  3. Python面试必须要看的15个问题
  4. ASP.NET 4.5.256 has not been registered on the Web server
  5. View的getLeft, getRight, getTop, getBottom
  6. bzoj3574[Hnoi2014]抄卡组
  7. 设置自己Eclipse代码风格(内部)
  8. iOS 给UITextView加一个placeholder
  9. base64_encode与base64_decode
  10. Mysql主从复制_模式之日志点复制
  11. 使用Setup factory打包WPF
  12. C++或C#调用外部exe的分析
  13. [C#]关于路径的几则笔记
  14. A1制作文件夹目录
  15. SNF软件开发机器人-子系统-功能-数据列表分页与不分页-瀑布式分页-如何配置?
  16. FileWriter向文件中写入内容
  17. chrome console 阻止 Navigated to
  18. ssh框架中,工具类调用service层方法(参考https://www.cnblogs.com/l412382979/p/8526945.html)
  19. ARP协议,以及ARP欺骗
  20. CSS 笔记(一)

热门文章

  1. Linux Linux共享库
  2. PHP基础17:日期
  3. jQuery调用WCF服务传递JSON对象
  4. 最短路径算法之Dijkstra算法(java实现)
  5. 访问图片可以使用闭包map
  6. UIStepper步进器 ——事件驱动型控件,(一个+和-按钮的)
  7. Opencv实现运动检测
  8. Jenkins进阶系列之——06FTP publisher plugin插件下载(支持绝对路径)
  9. openMP的一点使用经验【非原创】
  10. WINDOWS8.1安装ORACLE客户端及配置