Note that there are some explanatory texts on larger screens.

plurals
  1. POAttached DB in SQL Server Management Studio to copy a table and now Web app cannot access DB
    primarykey
    data
    text
    <p>In order to copy a table's data to a new table with additional fields the DB was attached in SQL Server Management Studio. Once the data was copied to the new table and the old table was dropped, the DB was detached. The DB was then opened in the development environment with Visual Studio and was accessible from the Server Explorer Data Connections. However, now the application cannot open the DB when running on the web server and gives an error saying: Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.</p> <p>The web.config application connection string is:</p> <pre><code>&lt;add name="ApplicationServices" connectionString="Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\ASPNETDB.mdf; Integrated Security=True; Connect Timeout=30; User Instance=True;" providerName="System.Data.SqlClient"/&gt; </code></pre> <p>I have read over 30 post on this type of error and everything I tried from the suggestion I found did not help. NT AUTHORITY\NETWORK SERVICE in in both the server's users and the DB's users with dbo.owner rights and the app pool for the web server is set to use NETWORK SERVICES. </p> <p>I am guessing that maybe SQL Server Management Studio made some changes to the DB when it was attached that are effecting the security access rights for the web server application, but not for direct data connections but for the life of me, I can not find what that may be. </p> <p>The application is being developed with Visual Studio 2013 for Web using a local IIS 7 server as localhost and SQLEXPRESS for the database server. The application development process has been going along fine up till now. However, at this point development has come to a halt and I am dead in my tracks until I can get this resolved. Any help would be appreciated!</p> <p>Thanks in advance! David</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload