Hi all,
I am using the fallowing code to encrypt connection string in my web.config. It is working wel when working in local server(vwd 2010), but when I move the files to hosting server I am getting eror. Eny idea?
Configuration
config = WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringsSection
connsection = (ConnectionStringsSection)config.GetSection("connectionStrings");
connsection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
config.Save();
stringipaddress;
ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if
(ipaddress == ""
|| ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];