A configuration file cannot be created for the requested Configuration object.
ConnectionStringSettings con = new ConnectionStringSettings();
con.ConnectionString = "Integrated Security=SSPI;Data Source=.;Initial Catalog=AnalyzeForm";
con.Name = "AppConnectionString"+Guid.NewGuid().ToString();
con.ProviderName = "System.Data.SqlClient";
// Add the new connection string to the web.config
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Web.config");
config.ConnectionStrings.ConnectionStrings.Add(con);
config.Save();
DbConfig.config如下:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
con.ConnectionString = "Integrated Security=SSPI;Data Source=.;Initial Catalog=AnalyzeForm";
con.Name = "AppConnectionString"+Guid.NewGuid().ToString();
con.ProviderName = "System.Data.SqlClient";
// Add the new connection string to the web.config
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Web.config");
config.ConnectionStrings.ConnectionStrings.Add(con);
config.Save();
DbConfig.config如下:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
...全文
相关推荐
导入工程的“The import android cannot be resolved”错误解决方法
导入工程的“The import android cannot be resolved”错误解决方法
java eclipse 出现 xxx cannot be resolved to a type 错误解决方法
主要介绍了java eclipse 出现 xxx cannot be resolved to a type 错误解决方法的相关资料,需要的朋友可以参考下
vs2010中Cannot find or open the PDB file简单总结
vs2010中Cannot find or open the PDB file简单总结
ASP.NET The system cannot find the file specified解决办法
主要介绍了ASP.NET The system cannot find the file specified解决办法的相关资料,需要的朋友可以参考下
estableRuntimeException cannot be resolved 解决
org.apache.commons.lang.exception.NestableRuntimeException cannot be resolved 解决 替换JAR包即可


