Connection string public module not working.
Posted on 2004-09-29
I have 2 .aspx pages that are populating their data connection string using a public constant that's stored in a module and am encountering mysterious behavior. For some reason, one of the pages doesn't detect the constants in the module.
Page #1 is older and works correctly, but Page #2 was just added and is giving me "[constant] has not been declared" error message. The codebehinds of the pages are almost identical, but the newer one isn't detecting the constant in the module, no matter how many times I rebuild the project (including deleting the old DLL, just to be on the safe side).
The place where it breaks in each code behind is:
> Dim sqlConn As New SqlConnection(PROVIDER_NAME)
The module in question looks like this:
> Public Module Common
> Public Const PROVIDER_NAME = "Initial Catalog=Client1;Data Source=WHATEVER;user id=blah;password=blah"
> Public Const CATALOG_NAME = "Client1"
> End Module
Any idea what the problem is?
Also, what's the word on modules in ASP.Net? Are they buggy?