I am working on construction ERP. When user adds new structure i have to create new database for each structure.Whether it is possible using script?
at the same time as i am creating new database for each structure then it is necessary to create one additional connection string in web.config file
very first i am trying to add new connection string in config file.for that i have written some code.but it gives me error.
string path = Server.MapPath(@"Web.config"); 'or' string path = Server.MapPath("~/Web.config");
var configuration = WebConfigurationManager.OpenWebConfiguration(path);
var section = (ConnectionStringsSection)configuration.GetSection("connectionStrings");
section.ConnectionStrings.Add(new ConnectionStringSettings(txtStructName.Text, txtStructName.Text, "System.Data.SqlClient"));
configuration.Save();
Error is :The relative virtual path is not allowed here.
help me to solve this problem.....