I took a hint from chapter 19, page 699 - "The web.config File - Expression Syntax", and now have the code-behind connection string within the web.config file, where it's easier to modify and keep track of.
In the web.config file:
Code:
<appSettings>
<add key="csConnectionString" value="data source=SOMESERVER;initial catalog=TEST; integrated security=SSPI;persist security info=False; Trusted_Connection=Yes"/>
</appSettings>
Just below the content tag of the web page:
Code:
<asp:Literal ID = "csConnectionString" runat="server" Visible="false" Text="<%$ AppSettings:csConnectionString %>" />
In the C# code-behind:
Code:
SqlConnection conn = new SqlConnection(@csConnectionString.Text);
If you need any help on your next book, please let me know, Imar!