Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have SQL Server 2000 installed on the server. I installed SQL Server 2008 R2 express edition as required for new application. The application runs on the same server which is Windows Server 2003 with IIS 6. SQL Express was installed as named instance. I can connect to SQLExpress via Management Studio.

The web application runs without any issues but as soon as it performs an operation which requires db it throws the following error.

Cannot open database requested in login 'dbname'. Login fails. Login failed for user 'NT AUTHORITY\SYSTEM'.

I have searched online for the solution but did not succeed in resolving it.

Here is what I tried.

  1. Set connection string to use windows authentication.

    <add name="conn" connectionString="data source=ServerName\SQLEXPRESS; 
         Initial Catalog=dbName; Integrated Security=SSPI; Instance=true" 
         providerName="System.Data.SqlClient"/>
    
  2. Set connection string to use verified credentials.

    <add name="conn" connectionString="data source=ServerName\SQLEXPRESS; 
                       Initial Catalog=dbName; User ID=uname; Password=passw" 
         providerName="System.Data.SqlClient"/>
    
  3. Tested that valid connection string is reflected in IIS => ASP setting

  4. Added user 'NT AUTHORITY\SYSTEM' as db_owner to my database

  5. Checked that NT AUTHORITY\NETWORK SERVICE also has all permissions to my database

  6. Checked that SQLEXPRESS service is actually running

Any help will be greatly appreciated.

share|improve this question

migrated from stackoverflow.com Dec 10 '10 at 13:51

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

SQL Server Express doesn't allow remote connections by default, after installation.

You need to take some extra steps to allow this to work.

Check out this Microsoft Knowledge Base article on how to do this. The KB article is about SQL Server 2005 Express, but the same still applies to SQL Server 2008 R2 Express.

share|improve this answer
add comment

This is not related to remote connection. The application and SQL server runs on the same machine. The problem is that the connection from the application to the SQL server is not getting established.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.