Sumi D

Sumi D

  • NA
  • 4
  • 4.3k

when I browse from IIs not add connection string to webconfig file

Nov 26 2011 2:06 AM
System.Configuration.ConnectionStringSettings connection = new

System.Configuration.ConnectionStringSettings("helloConnectionstring5", constr, "System.Data.SqlClient");
var settings = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(@"/");
settings.ConnectionStrings.ConnectionStrings.Add(connection);
settings.Save();
Global.StartupType = Global.STARTUP_TYPE.NORMAL;
lblstatus.Text = "Connection success and connectionstring updated in webconfig";


this is my code for adding connectionstring in webconfig file.
But this working in my local system.
after configuring IIS.when I browse from there it wont add connection string to webconfig file.

Answers (2)