Click here to Skip to main content
15,302,644 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi everyone,

I have classical ASP.Net web application, and my Connection string is in webconfig file. I published this to my iis server 8. When i run the iis application, the web application can not connect the local database.

What should i do for the connection? IIS Application pool settings or Web config Connection string settings?

My iis server url is localhost:8082 and i could not connect my Database.

Thanks a lot
Posted
Comments
ZurdoDev 28-Dec-13 22:09pm
   
What was the error? Why won't it connect?
Rana Zarour 29-Dec-13 5:56am
   
what is your connection string ?

1 solution

Database connectivity not depends on your local iis server/iisexpress or other things. It is depends on proper connection string which you store anywhere there you can access it and programatically read. No metter it is web.config or not. But usually we store it web.config file for easily read using System.ConfigurationManager class. Your problem is when you publish it, you can not connect to the database from your applicaton. If so please first check your web.config file after publishing your site. It would be better if you check it from file system. Means where your web application files are deployed. In that web.config files what the value it contains and that are really valid or not. You can write some code from your application and write some logs what connection string it finds when published and use try catch block and write log of this exception in details so that you can identify what the problem is.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900