在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
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(); } }
|
请发表评论