Friday, February 10, 2006 6:42 AM
Chris
ASP .Net 2.0 Membership and Profile problems
I recently installed the Team Suite version of Visual Studio 2005 and found that some demos that I have been doing for months were suddenly broken.
Whenever I used a demo that required use of the membership/profile database I would get "error: 26 - Error Locating Server/Instance Specified". I further discovered that the ASP .Net Configuration tool would fail whenever I tried to test the provider or enter the security tab.
This had me scratching my head a bit because I did not recall having any problems when I installed the RTM Pro version of Visual Studio 2005. In any case this problem had me doing a bit of a search.
The error was that the Sql Server instance could not be found. I started by looking at web.config. There was nothing about a connection there so I looked in VS 2005 Tools/Options/Database Tools. There I found a reference to SQLExpress. I assumed that was the problem so I cleared the entry so that it would use the default. Unfortunately my demos were still broken.
After a little bit of thought I decided to look in the "mother of all configuration files", machine.config. I was able to spot the problem. Here is what the connection string looked like:
"data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true".
When I installed Team Suite the default connection string for the local Sql Server was set to Sql Express. I changed this string to reflect the fact that I was using Sql Server 2005 and now all is well.
I hope that this information save someone some pain.