Hello
VS 2005
I am using the code below to get and save the connection string in the web.config file. However on the webConfig.Save() line it throws an error:
An error occurred loading a configuration file: Access to the path 'c:\inetpub\ is denied. (c:\inetpub\
I am not sure what this file is "oa48wsfg.tmp" and why I have access denied.
I have gone into the IIS and right click web.config and given read and write permissions. but still get the same error message.
Can anyone please help me with this problem.
Many thanks,
Steve
VS 2005
I am using the code below to get and save the connection string in the web.config file. However on the webConfig.Save() line it throws an error:
An error occurred loading a configuration file: Access to the path 'c:\inetpub\ is denied. (c:\inetpub\
I am not sure what this file is "oa48wsfg.tmp" and why I have access denied.
Code:
Dim cnnString As String
'Get the current connection string
cnnString = WebConfigurationManager.ConnectionStrings("serviceMasterConnectionString").ConnectionString()
cnn.ConnectionString = cnnString
'Save a new connection string
Dim WebConfig As Configuration
WebConfig = WebConfigurationManager.OpenWebConfiguration("~")
WebConfig.ConnectionStrings.ConnectionStrings("serviceMasterConnectionString").ConnectionString = "data source=steve01\ssd01; database=serviceMaster; user id=sa; pwd="
WebConfig.Save()'Error on this line.
I have gone into the IIS and right click web.config and given read and write permissions. but still get the same error message.
Can anyone please help me with this problem.
Many thanks,
Steve