4
When I run an application of the type website in visual studio, database connections work normally. But when trying to run IIS 7 to perform some tests, I get the following message:
Unable to open the "XXX" database requested by logon. Login failure.
User login failure 'IIS APPPOOL Dotnet4'.
The specific database with which I am having difficulties to connect I left the authentication method configured to be accessed through the Windows user login.
To conectionString
of my Web.config
looks like this:
<add name="LocalConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=XXX;Connect Timeout=3000; Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
Note: They told me I should go to app pool and configure the option Identity with the being of my user, however my user has password and is not accepting I add it in this dialog:
We already have answers that answer your question, but I just wanted to leave the link to SO-En to reinforce the responses!
– Marconi
Take a look at this https://blogs.msdn.microsoft.com/ericparvin/2015/04/14/how-to-add-the-applicationpoolidentity-to-a-sql-server-login/ and this https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities
– Guilherme Nascimento
extra: https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities-and-sql-server-express
– Guilherme Nascimento