I have created an .aspx page in .net and it graciously created the codebehind page for me. I added a sqlconnection to my .aspx page and I didn't want to set the connection string in the page because I'm used to keeping that in an include file or application variable. So, I did some searching around here and found out how to edit the web.config file from ...<BR><BR>http://aspnet.4guysfromrolla.com/articles/053102-1.aspx<BR><BR>However, when I go into the codebehind page and try to add the connection information from the web.config file like so...<BR><BR> private void InitializeComponent()<BR> { <BR> this.sqlConnection1 = new System.Data.SqlClient.SqlConnection(ConfigurationS ettings.AppSettings("connString") );<BR><BR> }<BR><BR>.. and then I click out of the code view, it removes the sqlconnection object from my .aspx page. Then I go back to the codebehind page and the sqlconnection initialization stuff is gone from the InitializeComponent method. So, my question is, how can I create a connection and not have it disappear on me but at the same time, have it look to a variable for it's connection string? I hope this made sense. Please ask if it didn't. Thanks.I do not think that you can add code to that method (I could be wrong. The code-behind in VS.NET generates this:<BR>/// <summary><BR> /// Required method for Designer support - do not modify<BR> /// the contents of this method with the code editor.<BR> /// </summary><BR> private void InitializeComponent()<BR> { <BR> this.Load += new System.EventHandler(this.Page_Load);<BR> }<BR> #endregion<BR><BR>Notice how it says "Do not modify the contents of this method in the code editor". What I usually do is declare a global variable that will hold the connection string:<BR>string mstrConn = ConfigurationSettings.AppSettings["webConn"];<BR>Then in any method that needs a connection, I will use:<BR>OleDbConnection objConn = new OleDbConnection(mstrConn);<BR>