Single declaration of connection string in application
<p>In my asp.net application I have added the connection string in each page <code>Page_Load</code> function and declared the string as public in top of the page.</p>

<p>I know this is wrong thing. The whole application is running the same connection, so I want to declare the connection string in only one place. Where should I declare the connection string? How can I access the connection string in each Connection?</p>

<pre><code>public string connstring = "";

protected void Page_Load(object sender, EventArgs e)
{
    if (IsPostBack != true)
    {
        connstring = ConfigurationManager.ConnectionStrings["connString"].ToString();
        MySqlConnection connection = new MySqlConnection(connstring);
        // ----
    }
}
</code></pre>
