简体   繁体   中英

MS SQL Server connectivity issue when application hosted to IIS

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!!!

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.

好吧,我建议您在IIS上查看应用程序池标识,并将其配置为在可访问SQL DB的Windows帐户下运行

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM