3

I have a MVC Application ,it is my connection string.

   <add name="BehkamContext" connectionString="Data Source=.;Initial Catalog=Behkam;Integrated Security=True;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />

Working with my project in debug I have no issues. However running it in IIS I am getting this error:

Cannot open database "Behkam" requested by the login. The login failed. Login failed for user 'WORKGROUP\DESKTOP-TFB5NSL$'.

I use <authentication mode="Windows"/> but get error.

I set Integrated Security=SSPI in connection sting but get error.

ar.gorgin
  • 4,765
  • 12
  • 61
  • 100
  • https://blog.lextudio.com/web-application-differences-in-visual-studio-and-iis-60fec7e311b3 Your application pool identity on IIS has no permission to read the database. – Lex Li Aug 08 '18 at 15:10
  • 2
    Possible duplicate of [Login failed for user 'DOMAIN\MACHINENAME$'](https://stackoverflow.com/questions/2806438/login-failed-for-user-domain-machinename) – Richardissimo Aug 08 '18 at 17:02

0 Answers0