Reputation: 2180
I've built a web application using VS 2015. While testing my application I simply run my application from visual studio. Everything works fine. Then when I hosted my application to IIS in my own local machine, the application cannot connect to SQL Server. I've not changed the web.config file and the authentication mode of SQL Server is Windows Authentication mode.
I checked the sql profiler, the profiler shows the executed stored procedures when I run my application from visual studio, but when I run my application under IIS, it does not shows any executed stored procedures.
Please can anyone help me what is the problem? I am stuck with this problem for few days, please help me guys!!!
Upvotes: 0
Views: 152
Reputation: 103
You have 2 solutions:
1) as Andrii Matus gave solution to change application pool identity in your IIS server, and
2) use default sql user "sa" or create new sql user "dev", then give rights to "dev" sql user for read/write operations and then user "dev" in your connection string in IIS as well as visual studio.
NOTE: if sql is not allowing you to connect with "sa" account then you have to enable "sa" account and set new password also.
Upvotes: 1
Reputation: 176
Well, I can suggest you to look on application pool identity on your IIS, and configure it to run under windows account with access to your SQL DB.
Upvotes: 0