'oledb32.dll' should be excluded because its source file 'C:\Program Files\Common Files\System\Ole DB\oledb32.dll' is under Windows System File Protection.
<body> <form id="form1" runat="server" > <div> Connection name:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> Connection string:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br /> Provider name:<asp:TextBox ID="TextBox3" runat="server">System.Data.SqlClient</asp:TextBox><br /> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click1" /> </div> </form> </body> protected void Button1_Click1(object sender, EventArgs e) { var configuration = WebConfigurationManager.OpenWebConfiguration("~"); var section = (ConnectionStringsSection)configuration.GetSection("connectionStrings"); section.ConnectionStrings.Add( new ConnectionStringSettings(TextBox1.Text, TextBox2.Text, TextBox3.Text) ); configuration.Save(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)