Web.Config AppSettings Escape Parentheses

If you need to add entries to your web.config and are using connection strings or AppSettings with parenthesis or <,>,& you will need to escape these characters as they are invalid in XML markup.

A simple way to fix this is use an online HTML encoder. Simply copy paste your code into the encoder on this site: http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/encode.aspx

Paste the output into your web.config markup. Run your program and your variable will load correctly!

Comments

  1. JetOleDb4ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"

    ReplyDelete

Post a Comment

Popular posts from this blog

WinDBG on 32Bit Applications

EXCEL Macro - Compare Column A to Column B

Powershell Script to Automatically Deploy Sharepoint WSP Packages