Hello Herb,
Welcome to the ASP.NET newsgroup.
From your description, I understand you have an ASP.NET 2.0/VS 2005 web
project. The application is configured to use SQL Server
provider(membership, role ...). The application can works at runtime,
however, when you use the web admin site to manage the web application's
security setting, you're getting "Unable to connect to SQL Server database"
error, correct? If there is anything I missed, please feel free to let me
know.
Based on my experience, such problem is possibly caused by security
permission issue when the webadmin site page try connecting to the target
SQL Server database engine.And this is a bit hard to troubleshoot from the
appearance.
Would please help me confirm the following things on your problem machine?
1. whether your ASP.NET 2.0 application is using the default local SQL
Express provider? Or have you manually changed to use other sqlserver
engine as the database provider?
2. If it is using the default sqlexpress provider, have you checked the
default "localSqlServer" connectionString value in the machine.config file
to see whether it remains the default value(with .net framework
installation)? The default value should look like below:
===========
<connectionStrings>
<add name="LocalSqlServer" connectionString="data
source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User
Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
===========
I have searched over the web and checked our internal database and found
some similar issues, some are caused by the user account doesn't have
sufficient permision, some are caused by the SQL Express is not correctly
installed.
AS for user account permission, since the web admin site will use the
current logon user(which is using visual studio) as the security identity,
I suggest you verfify whether the current user account has been added in
the machine's "users" group. If it is a domain account, it is naturally
added in the machine's users group.
As for Sql Express database, since the default "LocalSqlServer" connection
string use "User instance" setting, it will create dynamic sql express mdb
files under the following directory(and start a separate sqlserver instance
against it):
"C:\Documents and Settings\<username>\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS"
You can verify whether there is any mdf files there. If not exists, the
problem is possibly caused by the sql express user instance is not
correctly created. There may exists some issue with the sqlexpress
installation.
In addition, for generic troubleshooting, we can do the following tests:
1) use sql profiler to trace the sqlexpress's connecting status when the
web admin site try connecting to it
(need to have sqlserver 2005 workstation components installed)
2) use filemon tool to trace any NTFS file access failure on the machine:
http://www.sysinternals.com/utilities/filemon.html
Hope this helps you some. If there is anything unclear, please feel free to
let me know.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)