470,841 Members | 1,156 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,841 developers. It's quick & easy.

web.config appSettings Store value with & character

hi

i have stored my connction string in web.config as we do usually. code
of web.confing is given below.

check the password field contain "&" character. now when i run my
application it gives error because value of ConnectionString is breaked
at "&".

So how to store value in web.config that contain "&" character, if any
one know the solution pls let me know. code of web.config and error
given by visual studio is given below.

<configuration>
<appSettings>
<add key="ConnectionStri

ng" value="server=localhost;user id=mas;password=mas&2003;database=CMS"
/>
</appSettings>
....
....
and so on </configuration>

Error Give by VS 2003
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Reference to undeclared parameter entity, 'max'.

Source Error:

[No relevant source lines]
Source File: D:\dnSource\HOMEAPPS_mahesh\web.config Line: 0

Aug 8 '06 #1
2 8035
Instead of this:

value="server=localhost;user id=mas;password=mas&2003;database=CMS"

try this:

value="server=localhost;user id=mas;password=mas&2003;database=CMS"

the & will be converted to & when the value is retrieved from the web.config
"ma***********@gmail.com" wrote:
hi

i have stored my connction string in web.config as we do usually. code
of web.confing is given below.

check the password field contain "&" character. now when i run my
application it gives error because value of ConnectionString is breaked
at "&".

So how to store value in web.config that contain "&" character, if any
one know the solution pls let me know. code of web.config and error
given by visual studio is given below.

<configuration>
<appSettings>
<add key="ConnectionStri

ng" value="server=localhost;user id=mas;password=mas&2003;database=CMS"
/>
</appSettings>
....
....
and so on </configuration>

Error Give by VS 2003
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Reference to undeclared parameter entity, 'max'.

Source Error:

[No relevant source lines]
Source File: D:\dnSource\HOMEAPPS_mahesh\web.config Line: 0

Aug 8 '06 #2
hmmm... this post converted my xml ! lol

I entered in & a m p ; (no spaces) and it became & in the post ! LOL !!

Use &amp and a ; and this should work fine :P
Aug 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Guinness Mann | last post: by
5 posts views Thread by WFB | last post: by
8 posts views Thread by theWizard1 | last post: by
2 posts views Thread by Ian | last post: by
10 posts views Thread by Brett Romero | last post: by
6 posts views Thread by G | last post: by
3 posts views Thread by =?Utf-8?B?Sm9u?= | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.