Configuration ASP.Net Tutorial

<%@ Page Language="C#" %>


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            
            ConnectionStringSettings conn = new ConnectionStringSettings();
            conn.ConnectionString = "Server=localhost;User ID=sa;Password=password; Database=Northwind;Persist Security Info=True";
            conn.Name = "AppConnectionString2";
            conn.ProviderName = "System.Data.SqlClient";
            Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/YourRoot");
            config.ConnectionStrings.ConnectionStrings.Add(conn);
            config.Save();
        }
    }



    Untitled Page