I just implemented basic URL rewriting to change a page from, for example, /member.aspx?id=123 to /member.aspx/erik. That works and I'm happy with it. However, I am now getting an error message that states "the connectionstring property has not been initialized". Normally, I've been storing the connectionstring in web.config, and I access it with:
Dim Connect As SqlConnection = New SqlConnection
Dim ConnectString As String
ConnectString = ConfigurationManager.AppSettings("linktomysite")
Connect.ConnectionString = ConnectString
This is what I do on every other page of the site and it works fine. The only way it will work on the page where I'm URL re-writing, however, is if I replace "ConfigurationManager.AppSettings("linktomysite")" with the actual connection string itself. For security reasons, obviously I would prefer to keep that info out of the page. What can I do?
View Complete Post