简体   繁体   中英

IIS 7.5 MVC 5 deployed website will not connect to SQL Server

I have an ASP.NET MVC 5 website that works fine when it is running locally, but when deployed to the IIS 7.5 web server, it will not access SQL Server to pull up necessary information for the page.

The error it give says it is not able to get the connection settings from the web.config file. When I use the connection settings directly in the DB call, however; I do not get the error, but no information at all is pulled from the DB.

Here is my connection string if that helps:

server=servername;database=dbName;uid=Id;pwd=password

Can someone give me an idea of how I can correct the error?

Thank you in advance for all your help...

Finally solved it ... I believe the problem was that I originally configured it as a web app in the Default website in IIS and it was looking at the web.config for the Default website and not finding the access string it required to access the SQL server.

I made it it's own website and everything is running fine now...

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