I can read connection string from webconfig file from visual studio from the below mentioned code
in login.aspx page
Private constr As String
Private rootWebConfig As System.Configuration.Configuration
Private connString As System.Configuration.ConnectionStringSettings
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/WEBUI") where WEBUI is project folder where webconfig resides.
I created web deploy package and imported into localhost IIS 7. import application worked fine. when I tried to browse the login.aspx from IIS published folder I get the following msg
Server Error in '/KHWEB' Application. - KHWEB web application name in IIS7
Object reference not set to an instance of an object.
OpenWebConfiguration("./WE