Web Site Administration Tool



When I run the ASP.NET Web Site Administration Tool, it can never connect to
(or create) a provider. An error dialog always appears:

"Could not establish a connection to the database. If you have not yet
created the SQL Server database, exit the Web Site Administration tool, use
the aspnet_regsql command-line utility to create and configure the database,
and then return to this tool to set the provider."

But I HAVE created the database, using aspnet_regsql, which runs with no
problem. There is a database (in SQL Server 2005, not SQL Express) named
"aspnetdb"; it contains all the relevant tables. I'm able to add users.
I've tried modifying the connectionString in web.config, adding various
attributes, such as AttachDBFilename and UserInstance, that I've seen
mentioned in various web postings related to this topic. I've tried creating
another database directly in my App_Data folder and specifying it when
running aspnet_regsql (which seemed to have no effect; no tables were created)
I also notice that a defaultProvider attribute alternately gets added,
then removed, then added again to the <membership> section of web.config.

All of this effort has proven fruitless. Sometimes I can't even get the
Security tab to work; sometimes I can. But I can never get it to connect to
a data store. The whole thing acts as if were extremely fragile; a slight
change may upset everything. Sometimes, I get a typically obscure,
uninformative message such as

An error was encountered. Please return to the previous page and try again.

The following message may help in diagnosing the problem: Unable to connect
to SQL Server database. at System.Web.Administration.WebAdminPage.
CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[]
parameters, .....


What's wrong? Why am I having such a devil of a time trying to get this
thing to work?

.



Relevant Pages