Actually, it happens because the default database is unavailable at the time of connection. Most reasons are maybe because the database has been detached or maybe because the only available connection is already being used by someone else or maybe because the database has been set to the RESTRICTED_USER state and the user has been denied access.
In many cases, one solution that works (sometimes) is when you run the aspnet_regsql.exe from the command line. But most of the time, I add applicationName attribute to the web.config and it works really great!
When you copy the application to the IIS server, the membership provider has been added in the web.config file but without an applicationName attribute. I suggest you add an “applicationName” attribute to your provider declaration like this:
<membership>
<providers>
<add name ....
.
.
.
.
applicationName="/yourWebApp" />
</providers>
</membership>
Just look in the aspnet_Application table to find out the application
name that was used when creating the users/data during development.
No comments:
Post a Comment